Re: Warm-up cache may have its virtue - Mailing list pgsql-hackers

From Qingqing Zhou
Subject Re: Warm-up cache may have its virtue
Date
Msg-id Pine.LNX.4.58.0601052237500.15540@josh.db
Whole thread Raw
In response to Re: Warm-up cache may have its virtue  (Qingqing Zhou <zhouqq@cs.toronto.edu>)
List pgsql-hackers

On Thu, 5 Jan 2006, Qingqing Zhou wrote:
>
> Feasibility: Our bufmgr lock rewrite already makes this possible. But to
> enable it, we may need more work: (w1) make bufferpool relation-wise,
> which makes our estimation of data page residence more easy and reliable.
> (w2) add aggresive pre-read on buffer pool level. Also, another benefit of
> w1 will make our query planner can estimate query cost more precisely.
>

"w1" is doable by introducing a shared-memory bitmap indicating which
pages of a relation are in buffer pool (We may want to add a hash to
manage the relations). Theoretically, O(shared_buffer) bits are enough. So
this will not use a lot of space.

When we maintain the SharedBufHash, we maintain this bitmap. When we do
query cost estimation or preread, we just need a rough number, so this can
be done by scanning the bitmap without lock. Thus there is also almost no
extra cost.

Regards,
Qingqing




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: catalog corruption bug
Next
From: Greg Stark
Date:
Subject: Re: Improving N-Distinct estimation by ANALYZE