When does Postgres cache query plans? - Mailing list pgsql-general

From Mike Christensen
Subject When does Postgres cache query plans?
Date
Msg-id CABs1bs1zchcWTRm+OibONH_fddUtT_DP8LWi_tFN0A5k9NSvHg@mail.gmail.com
Whole thread Raw
Responses Re: When does Postgres cache query plans?
List pgsql-general
I'm curious under what circumstances Postgres will cache an execution
plan for a query.

Obviously if you create it with the PREPARE statement, it will be cached..

However, if I just run an ad-hoc query such as:

select * from Foo where X < 5;

A few hundred times, will that be cached?  What if I run:

select * from Foo where X < :value;

Can that be cached, or will it always be re-evaluated based on the
value of :value?  Thanks!

Mike


pgsql-general by date:

Previous
From: jam3
Date:
Subject: Re: Where is the char and varchar length in pg_catalog for function input variables
Next
From: Magnus Hagander
Date:
Subject: Re: "Too far out of the mainstream"