Re: [PGSQL 8.3.5] Use of a partial indexes - Mailing list pgsql-general

From Scott Marlowe
Subject Re: [PGSQL 8.3.5] Use of a partial indexes
Date
Msg-id dcc563d10812290733i7bd5c1d5jc569a7a77137b74a@mail.gmail.com
Whole thread Raw
In response to Re: [PGSQL 8.3.5] Use of a partial indexes  (Reg Me Please <regmeplease@gmail.com>)
List pgsql-general
On Mon, Dec 29, 2008 at 7:41 AM, Reg Me Please <regmeplease@gmail.com> wrote:
> Hi.
>
> The WHERE condition can be divided into a "slowly changing" part and in
> a "random" one. The random part is the one I change at every query to avoid
> result caching.
>
> The planner seems to be smart enough to "learn" while working but then
> I should see a change in the EXPLAIN output, which never happens.
>
> I also tried to restart PostgreSQL in order to force a cache flush, but
> again, once the new performances are in the don't get out!

I'm guessing that what happened is that when you created the partial
index, pgsql read the whole table in, and the OS cached it.
Subsequent accesses hit either pgsql's shared_buffers or the OS cache.

You could try unmounting and remounting the partition in addition to
restarting pgsql and see if that helps, or for sure, reboot.

Also, for the partial index to be chosen, it has to match pretty much
exactly the where clause.

pgsql-general by date:

Previous
From: Reg Me Please
Date:
Subject: Re: [PGSQL 8.3.5] Use of a partial indexes
Next
From: Scott Ribe
Date:
Subject: Re: [PGSQL 8.3.5] Use of a partial indexes