追è¨: rehash(auto-rehashãå«ã)ããã¨ãSQLæã®è£å®(seleã§ã¿ãæéµã¨ã)ãå¹ããªããªããã¨ãã¯ãåããã®äººã«æãã¦ãããã¾ããã
å人çã«ã¯ãSQLã¯ãmysql> help selectãã¨ãã§ãªã³ã©ã¤ã³ãã«ããã³ãã£ã¨åºãã®ã§ãã¹ãã¼ãã®è£å®ãã§ããããªãSQLã®è£å®ã¯ã¨ããããããããã¦ãããããªã¨æã£ã¦ãã¾ãã
常ã ããã¼ãã«åã¨ãè£å®ã§ããã¨ãããªã¼ã¨æã£ã¦ããã®ã§ãããã£ã¨ããã¦ã¿ããæãã¦ãããã¾ãããããã¼ã¼ã¼ã¼ã£ãï¼ id:mikihoshi++ id:tokuhirom++ id:precuredaisuki++
ãããã§å¹çã300%ä¸ããã¾ããã(Benchmark::Stopwatchã§è¨æ¸¬)
- mysqlã³ãã³ãã--auto-rehashãªãã·ã§ã³ãã¤ãã¦èµ·åãã
$ mysql --auto-rehash
- my.cnfã®[mysql]ã»ã¯ã·ã§ã³ã«auto-rehashã¨æ¸ãã¦ãã
$ cat ~/.my.cnf [mysql] prompt="\u@\h[\d]> " auto-rehash #show-warnings
- 対話çãªmysqlã§ãrehashã³ãã³ããå®è¡ãã
- ããã¯ãautoããããªãã®ã§ãuse XXXã§DBã移åããããè£å®åè£ãã¼ãã«ãrehashããå¿ è¦ããã
mysql> rehash