Re: Trying to track down weird query stalls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



dan@xxxxxxxxx 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.  Try something like this:

prepare foo(smallint) as ...
   where libinstance.architecture = $1
   ...

explain analyze execute foo(1);

If the plan you get from that is bad (and it often is), you should look
at avoiding a query prepare.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux