Search Postgresql Archives

Re: SRF called with optional NULL input runs 7x slower

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

 



Ow Mun Heng wrote:

> how can I debug or diagnose where the issues lies? Explain analyse
> doesn't do much since this is a Function Scan anyway.

Take them out of the function and EXPLAIN ANALYZE them as plain SQL.
Note that you should take the parameters out of the literal, so you need
to do something like 

PREPARE foo AS SELECT ...   replace code with $1, etc ...
EXPLAIN ANALYZE EXECUTE foo(code, ...)

Otherwise they would be treated as constants so the queries would be
planned differently.

(untested, so correct the syntax appropriately)

-- 
Alvaro Herrera                 http://www.amazon.com/gp/registry/DXLWNGRJD34J
"Before you were born your parents weren't as boring as they are now. They
got that way paying your bills, cleaning up your room and listening to you
tell them how idealistic you are."  -- Charles J. Sykes' advice to teenagers

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[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