Re: plpgsql plan cache - Mailing list pgsql-performance

From Tom Lane
Subject Re: plpgsql plan cache
Date
Msg-id 1801.1266873658@sss.pgh.pa.us
Whole thread Raw
In response to Re: plpgsql plan cache  (Joel Jacobson <joel@gluefinance.com>)
List pgsql-performance
Joel Jacobson <joel@gluefinance.com> writes:
> Hm, it is strange the query planner is using two different strategies
> for the same query?

They're not the same query.  One plan is generic for any value of the
parameters, the other is chosen for specific values of those parameters.
In particular, the unparameterized query depends very strongly on the
knowledge that not many rows will meet the RecordDate range constraint.
If you picked dates that were further apart you'd probably get something
that looked more like the other plan.

            regards, tom lane

pgsql-performance by date:

Previous
From: Joel Jacobson
Date:
Subject: Re: plpgsql plan cache
Next
From: Nikolas Everett
Date:
Subject: Re: plpgsql plan cache