Public bug reported:

When searching on a btree indexed LONGTEXT, using LIKE operand, on
strings that start with the % character, it appears the btree indexing
is not being used.

I've committed my sample data and code I was using to query to our repo:
http://code.google.com/p/archivematica/source/browse/trunk#trunk%2Fsrc%2FtestingTools%2Fbtree%20test

To test:
I inserted one set of data into one table, and an almost identical set into 
another.
The only difference between the two sets was one started with the % char and 
the other started with the * char.

I searched for each value, removing some characters from the end and
replacing with with the % wildcard.  It took 6 seconds to find all the
*, and with the same code it took 10 minutes to find all the ones
starting with %.

These %'s were escaped.
SELECT * FROM btreeTest WHERE currentLocation LIKE '%%transferDirectory...%'
SELECT * FROM btreeTest WHERE currentLocation LIKE '*transferDirectory...%'


Server version: 5.5.24-0ubuntu0.12.04.1 (Ubuntu)

** Affects: mysql-5.5 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1047105

Title:
  btree index not working for strings that start with the % char

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mysql-5.5/+bug/1047105/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to