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

Patch for seq scan & scan resistant bufmgr

From: "CK Tan" <cktan(at)greenplum(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Patch for seq scan & scan resistant bufmgr
Date: 2007-05-10 03:49:26
Message-ID: DFF2B67D-F649-4583-AA01-C1B2B476F0CB@greenplum.com (view raw or flat)
Thread:
Lists: pgsql-patches
Hi,

I am submitting a patch for review that:

1. for small relation (smaller than 60% of bufferpool), use the  
current logic
2. for big relation:
	- use a ring buffer in heap scan
	- pin first 12 pages when scan starts
	- on consumption of every 4-page, read and pin the next 4-page
	- invalidate used pages of in the scan so they do not force out  
other useful pages

4 files changed:
bufmgr.c, bufmgr.h, heapam.c, relscan.h

If there are interests, I can submit another scan patch that returns  
N tuples at a time, instead of current one-at-a-time interface. This  
improves code locality and further improve performance by another  
10-20%.

For TPCH 1G tables, we are seeing more than 20% improvement in scans  
on the same hardware.

------------------------------------------------------------------------ 
-
----- PATCHED VERSION
------------------------------------------------------------------------ 
-
gptest=# select count(*) from lineitem;
   count
---------
6001215
(1 row)

Time: 2117.025 ms

------------------------------------------------------------------------ 
-
----- ORIGINAL CVS HEAD VERSION
------------------------------------------------------------------------ 
-
gptest=# select count(*) from lineitem;
   count
---------
6001215
(1 row)

Time: 2722.441 ms


Suggestions for improvement are welcome.

Regards,
-cktan
Greenplum, Inc.


Attachment: PATCH
Description: application/octet-stream (20.1 KB)

Responses

pgsql-patches by date

Next:From: Jaime CasanovaDate: 2007-05-10 05:13:50
Subject: Re: [WIP] GUC for temp_tablespaces
Previous:From: Alvaro HerreraDate: 2007-05-10 02:09:53
Subject: Re: Implemented current_query

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