Re: Trying to track down weird query stalls - Mailing list pgsql-performance

From dan@sidhe.org
Subject Re: Trying to track down weird query stalls
Date
Msg-id 51413.199.172.169.17.1238447256.squirrel@localhost
Whole thread Raw
In response to Re: Trying to track down weird query stalls  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Trying to track down weird query stalls
List pgsql-performance
> dan@sidhe.org escribió:
>> > dan@sidhe.org escribió:
>> >
>> >> where libinstance.libdate <= 1238445044
>> >>    and libinstance.enddate > 1238445044
>> >>    and libinstance.libinstanceid = libobject.libinstanceid
>> >>    and libinstance.architecture = ?
>> >
>> > How are you generating the explain?  My bet is that you're just
>> > substituting a literal in the architecture condition, but if the
>> driver
>> > is smart then maybe it's preparating the query beforehand.  You'll get
>> a
>> > different plan in that case.
>>
>> I don't think so. Perl's DBI is involved, but the statement's in a
>> variable.
>
> So what's the "?" in the query you pasted earlier?

The first ? (for architecture) is 1, the second ? (for branchid) is 0.
They both should get passed to Postgres as $1 and $2, respectively,
assuming DBD::Pg does its substitution right. (They're both supposed to go
in as placeholders)

-Dan

pgsql-performance by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Trying to track down weird query stalls
Next
From: Alvaro Herrera
Date:
Subject: Re: Trying to track down weird query stalls