Skip to content

Gary Pendergast

I'm on the Internet

Tag: optimizer

Don’t put a NULL in the IN clause in 5.1

There seems to be an optimizer problem in 5.1, if you put a NULL in the IN clause of a SELECT. For example, given the following table: CREATE TABLE foo ( a INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (a) ); Compare these two EXPLAINs: mysql> EXPLAIN * FROM foo WHERE a IN (160000, 160001, 160002)\G… Continue reading Don’t put a NULL in the IN clause in 5.1

Published April 8, 2009
Categorized as MySQL Tagged MySQL 5.1, optimizer, regression
Picture of Gary Gary Pendergast, noun: MySQL, WordPress, web and music geek. Writes poetry with Automattic. Can be observed in his natural habit at pento.net, or usually in Melbourne, Australia.

  • Twitter
  • Facebook
  • GitHub
  • Photo blog
Gary Pendergast
Privacy Policy
Proudly powered by WordPress.