1000ä¸ä»¶ãããã®ãã¼ãã«ããã£ã¦ã
ãããã LIMIT OFFSET ã§ãã¼ã¿ãåå¾ãããã ãã©ã
OFFSET ã®å¤ã大ãããã°å¤§ããã»ã©ãé
ããªãã
ãªãé
ãã®ã?
ã¨æã£ã¦ EXPLAIN ãå®è¡ããã¨ããã
LIMIT OFFSET 㯠ãã¼ãã«ãã«ã¹ãã£ã³(ALL) ã ã£ãã»ã»ã»ã
ãªãã¨ãªãã¤ã³ããã¯ã¹ãå¹ãã¦ãããã®ã ã¨æã£ã¦ããã
ããã§ããªãã£ãã
--- è¿½è¨ 2014/11/10 ---
ã³ã¡ã³ãã«ã¦
ãALLã«ãªãã®ã¯ãä½ããã®ãã¼ã§ã½ã¼ãããªãã¨ALLã«ãªãã¾ãã
ã¨ã®ãææãããã ãã¾ããã
----------------------
--- è¿½è¨ 2014/06/13 ---
ãªãããã®è¨äºã®é²è¦§æ°ãå¢ãã¦ããã®ã§å
容ãå確èªãã¦ã¿ã¾ããã
ã¬ã³ã¼ãæ°ãå¤ããªã㨠LIMIT OFFSET ãé
ãã¨ããã®ã¯ééããªãã¨æãã
ãã ãä¸è¨ã®ãLIMIT OFFSET 㯠ãã¼ãã«ãã«ã¹ãã£ã³(ALL) ã ã£ããã¨ããã®ã¯
ãã¹ãã§ä½¿ã£ããã¼ãã«ã§ explain ãã¦ã¿ãçµæãªã®ã§ã
ãã¼ãã«ã«ãã£ã¦éãããããã¾ããã
---------------------
ã»ã¨ãã©ã®ãã¼ãã«ã«ã¯ INTEGERå ã®ä¸»ãã¼ãä»ãã¦ããã®ã§ã
ããã BETWEEN AND ã§æå®ããã
主ãã¼ã«ã¯ããã©ã«ãã§ã¤ã³ããã¯ã¹ãä»ãã¦ããã®ã§ã
ç¯å²æ¤ç´¢(range)ã«ãªãã
SELECT * FROM tb_test WEHRE id BETWEEN 9000000 AND 900100; or SELECT * FROM tb_test WEHRE id >= 9000000 limit 100;
ããã¯ä¾¿å©ã ã»ã»ã»ã
ã¡ãªã¿ã«ãLIMIT ã使ãå ´åã¯ãæ¡çªã«æãããªãå ´åã«ã®ã¿æå¹ã
æããããå ´åã¯BETWEENã§å§ã¾ãã¨çµãããæå®ããªãã¨ã
åå¾ãããã¼ã¿ãéè¤ããå¯è½æ§ãããã