Re: [GENERAL] Prepared statement's planning

2008-01-15 Thread Vyacheslav Kalinin
On Jan 15, 2008 7:58 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > If that really is the behavior you want, and not a typo It is, most of parameters passed to a plpgsql function are in fact parts of the filter and if certain filter item is null it is considered unknown and we don't want it to affect th

Re: [GENERAL] Prepared statement's planning

2008-01-15 Thread Tom Lane
"Vyacheslav Kalinin" <[EMAIL PROTECTED]> writes: > QUERY PLAN > Bitmap Heap Scan on t1 (cost= 151.74..5307.59 rows=5000 width=8) > Recheck Cond: ((val > $1) AND (val < $2)) > -> Bitmap Index Scan on idx_t1 (cost=0.00..150.49 rows=5000 width=0) > Index Cond: ((val > $1) AND (val < $2)

[GENERAL] Prepared statement's planning

2008-01-15 Thread Vyacheslav Kalinin
Hello, I would appreciate if someone explained me how exactly prepared parametrized statements are planned, i.e. what kind of assumptions planner makes on param values, selectivity, expected row count etc. that affect in particular whether indexes will be used or not. For instance consider the fol