Redis Research (19th)-command attributes, redis research command attributes
Different Redis commands have different attributes, such as whether it is a read-only command or an administrator command. A command can have multiple attributes. In some special cases, commands with different attributes may have different performances. Next we will introduce them one by one.
1. redis_pai_write
Commands with the REDIS_CMD_WRITE attribute modify the data of the Redis database. A read-only slave database rejects the execution of commands with the redis_assist_wri TE attribute. In addition, after executing the command with the redis_assist_random attribute in the Lua script, the command with the redis_assist_write attribute cannot be executed, otherwise, an error occurs: "Write commands not allowed after non deterministic commands. "The command with the REDIS_CMD_WRITE attribute is as follows,
SETSETNXSETEXPSETEXAPPENDDELSETBITSETRANGEINCRDECRRPUSHLPUSHRPUSHXLPUSHXLINSERTRPOPLPOPBRPOPBRPOPLPUSHBLPOPLSETLTRIMLREMRPOPLPUSHSADDSREMSMOVESPOPSINTERSTORESUNIONSTORESDIFFSTOREZADDZINCRBYZREMZREMRANGEBYSCOREZREMRANGEBYRANKZUNIONSTOREZINTERSTOREHSETHSETNXHMSETHINCRBYHINCRBYFLOATHDELINCRBYDECRBYINCRBYFLOATGETSETMSETMSETNXMOVERENAMERENAMENXEXPIREEXPIREATPEXPIREPEXPIREATFLUSHDBFLUSHALLSORTPERSISTRESTOREMIGRATEBITOP
2. redis_assist_denyoom
Commands with the redis_pai_denyoom attribute may increase the storage space occupied by Redis. Obviously, all commands with this attribute have the redis_pai_wri attribute, but vice versa. For example, the DEL command has the redis_into_write attribute, but it always reduces the space occupied by the database, so it does not have
REDIS_CMD_DENYOOM attribute.
When the space occupied by the database reaches the value specified by the maxmemory parameter in the configuration file and cannot be released according to the space release rule of the maxmemory-policy parameter, Redis rejects the command that has the REDIS_CMD_DENYOOM attribute.
Commands with the REDIS_CMD_DENYOOM attribute do not necessarily increase the occupied space of the database during each call, but are only possible. For example, the SET command reduces the space occupied by the database when the length of the new value is smaller than the old value. However, in any case, when the occupied space of the database exceeds the limit, Redis will refuse to possess
The REDIS_CMD_DENYOOM attribute command does not analyze whether it actually increases space usage. Command with REDIS_CMD_DENYOOM attribute,
SETSETNXSETEXPSETEXAPPENDSETBITSETRANGEINCRDECRRPUSHLPUSHRPUSHXLPUSHXLINSERTBRPOPLPUSHLSETRPOPLPUSHSADDSINTERSTORESUNIONSTORESDIFFSTOREZADDZINCRBYZUNIONSTOREZINTERSTOREHSETHSETNXHMSETHINCRBYHINCRBYFLOATINCRBYDECRBYINCRBYFLOATGETSETMSETMSETNXSORTRESTOREBITOP
3. redis_assist_noscript
Commands with the REDIS_CMD_NOSCRIPT attribute cannot be executed in Redis scripts. The EVAL and EVALSHA commands also have this attribute. Therefore, you cannot call these two commands in the script, that is, you cannot call the script in the script.
The command with the REDIS_CMD_NOSCRIPT attribute is as follows:
BRPOPBRPOPLPUSHBLPOPSPOPAUTHSAVEMULTIEXECDISCARDSYNCREPLCONFMONITORSLAVEOFDEBUGSUBSCRIBEUNSUBSCRIBEPSUBSCRIBEPUNSUBSCRIBEWATCHUNWATCHEVALEVALSHASCRIPT
4. redis_assist_random
After a script executes a command with the redis_assist_random attribute, it cannot execute a command with the redis_assist_write attribute. The command with REDIS_CMD_RANDOM is as follows,
SPOPSRANDMEMBERRANDOMKEYTIME
5. redis_pai_sort_for_script
Commands with the redis_pai_sort_for_script attribute generate random results. Redis sorts the results when these commands are called in the script.
The command with the redis_pai_sort_for_script attribute is as follows,
SINTERSUNIONSDIFFSMEMBERSHKEYSHVALSKEYS
6. redis_assist_loading
When Redis is being started (loading data from the hard disk to the memory), Redis will only execute commands with the redis_assist_loadi NG attribute.
The command with the redis_uplo_loading attribute is as follows:
INFOSUBSCRIBEUNSUBSCRIBEPSUBSCRIBEPUNSUBSCRIBEPUBLISH