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

Bitmap index scan preread using posix_fadvise (Was: There's random access and then there's random access)

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: PostgreSQL-development Hackers <pgsql-patches(at)postgresql(dot)org>
Cc: Kevin(dot)Grittner(at)wicourts(dot)gov
Subject: Bitmap index scan preread using posix_fadvise (Was: There's random access and then there's random access)
Date: 2008-01-30 17:22:20
Message-ID: 87ejbzb54j.fsf@oxford.xeocode.com (view raw or flat)
Thread:
Lists: pgsql-patches
Here's the WIP patch for doing prereading when doing bitmap index scans.

I was performance testing it as I was developing it here:

http://archives.postgresql.org/pgsql-hackers/2007-12/msg00395.php

Note that this only kicks in for bitmap index scans which are kind of tricky
to generate. I used the attached function to generate them in the post above.

Also note I wouldn't expect to see much benefit unless you're on a raid array,
even a small one. But if you are on a raid array then the benefit should be
immediately obvious or else posix_fadvise just isn't working for you. I would
be interested in hearing on which OSes it does or doesn't work. 

*If* this is the approach we want to take rather than restructure the buffer
manager to avoid taking two trips by marking the buffer i/o-in-progress and
saving the pinned buffer in the bitmap heap scan then this is more or less in
final form. Aside from some autoconf tests and the documentation for the GUC I
think it's all in there.


Attachment: randomarray.c
Description: text/x-csrc (541 bytes)
Attachment: bitmap-preread-v5.diff.gz
Description: application/octet-stream (5.2 KB)

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2008-01-30 17:22:28
Subject: Re: [PATCHES] Proposed patch: synchronized_scanning GUC variable
Previous:From: Tom LaneDate: 2008-01-30 17:19:22
Subject: Re: [PATCHES] Proposed patch: synchronized_scanning GUCvariable

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group