Re: [PERFORM] Perl Binding affects speed?

2011-02-25 Thread Sam Wong
From: Martin Kjeldsen, Sent: 2011/2/25, 20:59 > > On 25/02/2011, at 13.25, Marti Raudsepp wrote: > > > On Fri, Feb 25, 2011 at 05:02, Sam Wong wrote: > >> * But if I do this - using binding: > >> $dbh->selectall_arrayref("SELECT * from shipment_lookup WHERE > >> (UPPER(lookup) LIKE ?)", undef,

Re: [PERFORM] Perl Binding affects speed?

2011-02-25 Thread Martin Kjeldsen
On 25/02/2011, at 13.25, Marti Raudsepp wrote: > On Fri, Feb 25, 2011 at 05:02, Sam Wong wrote: >> * But if I do this - using binding: >> $dbh->selectall_arrayref("SELECT * from shipment_lookup WHERE (UPPER(lookup) >> LIKE ?)", undef, '0GURG5YGVQA9%'); >> It took 10 seconds to finish the query,

Re: [PERFORM] Perl Binding affects speed?

2011-02-25 Thread Marti Raudsepp
On Fri, Feb 25, 2011 at 05:02, Sam Wong wrote: > * But if I do this - using binding: > $dbh->selectall_arrayref("SELECT * from shipment_lookup WHERE (UPPER(lookup) > LIKE ?)", undef, '0GURG5YGVQA9%'); > It took 10 seconds to finish the query, just like it was using full table > scan instead! Even

[PERFORM] Perl Binding affects speed?

2011-02-25 Thread Sam Wong
I run into performance problem when I pass the condition/variable in binding ways, however if I put them in the query string it's absolutely fine. Here is my table and index: CREATE TABLE shipment_lookup ( shipment_id text NOT NULL, lookup text NOT NULL ); CREATE INDEX shipment_lookup_pre