redis-doc
redis-doc copied to clipboard
lolwut is missing computational complexity
Hello @stockholmux
LOLWUT is not a regular command, and imo complexity is meaningless for it.
I'm with you however... LOLWUT output should be fast to generate so that the command can be called in production instances without issues. It should remain fast even when the user experiments with odd parameters. this seems meaningless (or more of a requirement rather than docs).
If we're saying 'run it on production' perhaps we need to back that up with something reasonable.
The complexity for each different LOLWUT may also be different, depending on what it does and the args it takes... Perhaps it would be better to retract the "safe to run in production" claim rather than try and work out a reasonable complexity to constrain future LOLWUTs to..?
@AngusP Fair enough. I would support removing 'run in production' to solve this particular issue.
Hey folks, since LOLWUT has always hard limits to the arguments that may make it more expensive, it is effectively an O(1) command.
I would say that every LOLWUT version which is not O(1), has a bug.
BTW, besides LOLWUT, we also have the following non-complexified commands - would it make sense iyo to add complexity to these as well?
- AUTH
- BGREWRITEAOF
- BGSAVE
- CONFIG GET
- CONFIG REWRITE
- CONFIG SET
- DBSIZE
- DEBUG OBJECT
- DEBUG SEGFAULT
- DISCARD
- ECHO
- EXEC
- FLUSHALL
- FLUSHDB
- INFO
- LASTSAVE
- MEMORY DOCTOR
- MEMORY HELP
- MEMORY MALLOC-STATS
- MEMORY PURGE
- MEMORY STATS
- MONITOR
- MULTI
- PING
- QUIT
- ROLE
- SAVE
- SELECT
- SHUTDOWN
- SLAVEOF
- REPLICAOF
- SLOWLOG
- SWAPDB
- SYNC
- PSYNC
- LATENCY DOCTOR
- LATENCY GRAPH
- LATENCY HISTORY
- LATENCY LATEST
- LATENCY RESET
- LATENCY HELP
I think it would be good to either give a time-complexity, or a quick note as-to why there isn't one. Some of those given above by @itamarhaber are certainly expensive! (BGREWRITEAOF, SAVE, REPLICAOF, etc.)
e.g. in the case of EXEC, it itself adds basically no time (O(1)) but the transaction runtime depends on what you put in the transaction...
Maybe we should have a shared sheet with this commands and the time complexity, and work at the list. When looks ok, we can put it into the JSON.
This was determined to be a code issue/requested enhancement, closing.