Re: Poor performance with WHERE Value like 'XXX%'

2007-04-05 Thread Dan Buettner
Rod, I'm speculating here, but I think what's happening is that too many of your entries have a PRODUCT_ID that starts with 'DRM' to make your index useful. When MySQL expects an index query to match more than around 30% of all rows, it will instead proceed with a table scan, estimating that to b

Poor performance with WHERE Value like 'XXX%'

2007-04-05 Thread Rod Heyd
Hi Folks, I'm getting some unexpectedly poor performance from some queries using the like operator. The table is an Innodb table with an index on the column appearing in a like conditional. Explain gives me this: [localhost]>explain select PRODUCT_ID from My_Table where PRODUCT_ID like 'DRM_00