in reply to Re: Re: Re: (tye)Re2: DBI, quoting, and LIKE searches
in thread DBI, quoting, and LIKE searches
Well, the theoretical situation i was talking about would have the wildcard at the end of the string instead of the beginning, so I could see that it would have a place to start in the index. However, after some reading of the PostgreSQL docs (the database I'm using for this particular project) and doing an EXPLAIN on several queries, it looks like PostgreSQL does not use the index at all if it is any sort of LIKE query (even WHERE id LIKE '42'), but will use the index on a regular query (WHERE id = '42'). Though I suspect this could differ with another databse.