Re: constant vs function param differs in performance - Mailing list pgsql-performance

From Tom Lane
Subject Re: constant vs function param differs in performance
Date
Msg-id 5187.1068843554@sss.pgh.pa.us
Whole thread Raw
In response to constant vs function param differs in performance  ("SZŰCS Gábor" <surrano@mailbox.hu>)
List pgsql-performance
"=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" <surrano@mailbox.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

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Help with count(*)
Next
From: "Nick Fankhauser"
Date:
Subject: n_distinct way off, but following a pattern.