Re: constant vs function param differs in performance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: SZŰCS Gábor <surrano(at)mailbox(dot)hu>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: constant vs function param differs in performance
Date: 2003-11-14 20:59:14
Message-ID: 5187.1068843554@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" <surrano(at)mailbox(dot)hu> writes:
> I have two SQL function that produce different times and I can't understand
> why.

The planner often produces different plans when there are constants in
WHERE clauses than when there are variables, because it can get more
accurate ideas of how many rows will be retrieved.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Nick Fankhauser 2003-11-14 21:27:16 n_distinct way off, but following a pattern.
Previous Message Tom Lane 2003-11-14 20:38:46 Re: Help with count(*)