Can someone explain why there is such a big performance difference in these
two queries? Note: I have a multicolumn index on ltid and inuse.
mysql> UPDATE leads SET inuse='0' WHERE inuse!='0' and ltid='8' and
inuse<'1098298863';
Query OK, 0 rows affected (46.35 sec)
Rows matched: 0 Changed: 0 Warnings: 0
mysql> UPDATE leads SET inuse='0' WHERE inuse='1' and ltid='8' and
inuse<'1098298863';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0
The one that tests by ='1' is almost instant, while the one that tests !='0'
takes 40 seconds! Is this just something strange, or is there some principle
that I am missing?
I just noticed that using "WHERE inuse>'0' " also is instanteous.
Thanks!!
Shane