develooper Front page | perl.dbi.users | Postings from February 2012

Re: same query, two different approaches, vastly different performance

Thread Previous | Thread Next
From:
Puneet Kishor
Date:
February 13, 2012 17:08
Subject:
Re: same query, two different approaches, vastly different performance
Message ID:
1BE8110B-0E58-4F33-AFCA-DFE8213D6436@gmail.com

On Feb 13, 2012, at 6:57 PM, David Nicol wrote:

> did you find
> 
> http://stackoverflow.com/questions/1566717/postgresql-like-query-performance-variations
> 
> in your research?


Thanks for that link, but I don't think that applies in my case. I have two exact queries, with a postfix wildcard search. One, I prepare with the search term embedded in the query. The other is prepared with a bind variable and the search term is added during $sth->execute.

The first one uses the index. The second does a full-table scan.

Strange, but true.



--
Puneet Kishor
Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About