Search Postgresql Archives

Re: Query runs fast or slow

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

 



felix-accts-pgsql@xxxxxxxxxxx writes:
> EXPLAIN ANALYZE doesn't show the slow timing
> because it requires values, not $n placeholders,

To analyze the plan used for a parameterized query, try

	PREPARE foo(...) AS SELECT ... $n ...

	EXPLAIN ANALYZE EXECUTE foo(...)

But I already know what you're going to find: the planner's estimates
for the range query are not going to be very good when it has no idea
what the range bounds are.  This is a situation where it may be best
to absorb the hit of re-planning each time instead of using a generic
parameterized plan.

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux