ãã®è¨äºã¯ MySQL Casual Advent Calendar 2017 ã®23æ¥ç®ã®è¨äºã§ãã ã¿ãªããORãããã¼ã¯ä½¿ã£ã¦ãã¾ããï¼ åã¯ä»äºã¨ã趣å³ã§ActiveRecordã¨ããORãããã¼ã使ã£ã¦ãããã§ããã©ãããã¤ä¾ãã° Team.preload(players: :high_score).to_a ã¿ãããªãã¨ãããã¨ãã SELECT `scores`.* FROM `scores` FROM `scores`.`id` IN (a, b, c, ...æ°ååç¶ã...) ã¿ãããªã¯ã¨ãªãçæããããã§ããã©ãMySQL 5.7ã«ä¸ããã¨ãã« range_optimizer_max_mem_size ã®å¶éã§å®è¡è¨ç»ããã¼ãã«ã¹ãã£ã³ã«è½ã¡ã¦ãããç®ã«ãã£ããã¨ãããã¾ãããMySQLå´ã§ range_optimizer_max_mem_size = 0 ãããã¨ã§
{{#tags}}- {{label}}
{{/tags}}