Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: Cached Query Plans (was: global prepared statements)


  • From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
  • To: PFC <lists(at)peufeu(dot)com>
  • Cc: Dawid Kuroczko <qnex42(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
  • Subject: Re: Cached Query Plans (was: global prepared statements)
  • Date: Mon, 14 Apr 2008 10:34:38 +0200
  • Message-id: <1208162078.8259.259.camel@PCD12478> <text/plain>

> 	The hairiness is in the plan dependence (or independence) on parameter  
> values, ideally we only want to cache plans that would be good for all  
> parameter values, only the user knows that precisely. Although it could be  
> possible to examine the column histograms...

If cached plans would be implemented, the dependence on parameter values
could be solved too: use special "fork" nodes in the plan which execute
different sub-plans depending on special parameter values/ranges,
possibly looking up the stats at runtime, so that the plan is in a
compiled state with the "decision points" wired in.

This of course would mean a lot heavier planning and possibly a lot
bigger plans, but you could afford that if you cache the plan. You could
even have a special command to plan a query this way.

Cheers,
Csaba.





Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group