pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pierre C <lists@peufeu.com>
To: Joel Jacobson <joel@gluefinance.com>
To: Nikolas Everett <nik9000@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: plpgsql plan cache
Date: Mon, 22 Feb 2010 23:15:30 +0100
Message-ID: <op.u8jur4ndeorkce@localhost> (raw)
In-Reply-To: <8bdec0841002221347m1c4556a4xb670877aab429a13@mail.gmail.com>
References: <38E2265E-B38E-4EBD-BB87-23B46EF4FD1C@gluefinance.com>
	<op.u8jnpjikeorkce@localhost>
	<8AD3F6B6-BCCF-46E1-B255-9EB8E761653B@gluefinance.com>
	<d4e11e981002221323l78eb946cv23dcf7c54aae5822@mail.gmail.com>
	<8bdec0841002221347m1c4556a4xb670877aab429a13@mail.gmail.com>


Actually, planner was smart in using a bitmap index scan in the prepared  
query. Suppose you later EXECUTE that canned plan with a date range which  
covers say half of the table : the indexscan would be a pretty bad choice  
since it would have to access half the rows in the table in index order,  
which is potentially random disk IO. Bitmap Index Scan is slower in your  
high-selectivity case, but it can withstand much more abuse on the  
parameters.

PG supports the quite clever syntax of EXECUTE 'blah' USING params, you  
don't even need to mess with quoting.



view thread (7+ messages)

Message-ID: <op.u8jur4ndeorkce@localhost>
Permalink:  ../op.u8jur4ndeorkce@localhost/
Also on:    postgresql.org/message-id/op.u8jur4ndeorkce@localhost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: lists@peufeu.com, joel@gluefinance.com, nik9000@gmail.com
  Subject: Re: plpgsql plan cache
  In-Reply-To: <op.u8jur4ndeorkce@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox