[PERFORM] Performance of SQL Function versus View

2012-02-29 Thread Igor Schtein
Do you see any performance difference between the following approaches? The assumption is that most of the rows in the query will be requested often enough. 1. SQL function. CREATE OR REPLACE FUNCTION X(IN a_id uuid, IN b_id uuid) RETURNS int STABLE AS $$ SELECT count(1) F

[PERFORM] How to clock the time spent for query parsing and planning?

2011-12-27 Thread Igor Schtein
I'd like to find some measurements/figures of query preparation and planning time to justify the use of prepared statements and stored procedures. I know that complex queries have larger preparation time. Though, is it possible to explicitly measure the time the optimizer spends parsing and plannin