Re: plpgsql plan cache

From: "Pierre C" <lists(at)peufeu(dot)com>
To: "Joel Jacobson" <joel(at)gluefinance(dot)com>, "Nikolas Everett" <nik9000(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: plpgsql plan cache
Date: 2010-02-22 22:15:30
Message-ID: op.u8jur4ndeorkce@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


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.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Smith 2010-02-23 01:04:35 Re: SSD + RAID
Previous Message Joel Jacobson 2010-02-22 21:47:15 Re: plpgsql plan cache