What is the KEYS

Syntax

  • Time complexity O(N)

    • ์ฆ‰ ์กด์žฌํ•˜๋Š” ๋ชจ๋“  ํ‚ค๋ฅผ ๋‹ค ์ฐพ์•„๋ณธ๋‹ค๋Š” ๋œป.

  • Prod ํ™˜๊ฒฝ์ผ ๋•Œ๋Š” ์‚ฌ์šฉํ•˜๋ฉด ์•ˆ๋จ.

    • ํ•ด๋‹น ์ปค๋งจ๋“œ๊ฐ€ ์‹คํ–‰๋  ๋™์•ˆ, ๋‹ค๋ฅธ ๋ช…๋ น์–ด๋“ค์€ ๊ธฐ๋‹ค๋ฆฌ๊ณ  ์žˆ์„ ํ…Œ๋‹ˆ (์‹ฑ๊ธ€ ์Šค๋ ˆ๋“œ๋‹ˆ๊นŒ.)

    • [[SCAN]] ์ด๋‚˜ [[SETS]] ๋ช…๋ น์–ด๋ฅผ ๊ณ ๋ คํ•˜๋ผ.

Do not use KEYS keyword

  • ์™œ?

  • ๋ชจ๋“  ํ‚ค๋ฅผ ๋‹ค ์ฐพ์•„๋ณด๊ธฐ ๋•Œ๋ฌธ์—

References

  • https://redis.io/commands/keys

  • https://tech.kakao.com/2016/03/11/redis-scan/

  • https://rdbtools.com/blog/redis-delete-keys-matching-pattern-using-scan/

Last updated