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

possible patch to increase number of hash overflow pages?

From: Stephen Ramsey <sramsey(at)internap(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: possible patch to increase number of hash overflow pages?
Date: 2001-06-14 17:29:02
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Hello all,

I hope it is OK to post to this mailing list regarding this issue (if not,
please let me know...).

I was attempting to index an int4 column on a table with 6x10^7 rows using
the "hash" index algorithm under PostgreSQL 7.1 on Debian Linux, and
received the following error message:

nubs=# create index throughput_index_service_fk on throughput_datum using
hash (service_fk);

ERROR:  HASH: Out of overflow pages.  Out of luck.

Looking into the source code a bit, it looked (to my untrained eye) as if
it might be possible to increase the number of overflow pages, with a
patch to src/include/access/hash.h to use a 32-bit "overflow page address"
data type rather than a 16-bit "overflow page address" data type.  
However, I really don't know much about the internals of postgres or its
hash algorithm, so I thought I should ask to see if this change would be
at all workable.  If doing this is just a *bad* idea, please let me know;
I'm new to Postgres and am guessing this issue must have come up before...

Here is the patch:

sramsey.ocp$ diff hash.h
> /* SAR hacking this to see if the overflow page addresses can be
increased in size to 32 bits */
< typedef bits16 OverflowPageAddress;
> /*typedef bits16 OverflowPageAddress;*/
> typedef bits32 OverflowPageAddress;
< #define SPLITSHIFT            11
< #define SPLITMASK             0x7FF
> #define SPLITSHIFT            24
> #define SPLITMASK             0xFFFFFF
< #define NCACHED                       32
> #define NCACHED                       256

Will this work?  Please CC "sramsey(at)internap(dot)com" for any replies, because
I'm not on the mailing list.

Thanks in advance,
Steve Ramsey

Stephen Ramsey

Software Engineer
Core Software Development
Internap Network Services

e-mail           sramsey(at)internap(dot)com
telephone	 206.504.5361
facsimile	 206.447.1870


pgsql-patches by date

Next:From: Tom LaneDate: 2001-06-14 17:51:28
Subject: Re: Removal of temp tables
Previous:From: Bruce MomjianDate: 2001-06-14 17:25:37
Subject: Re: Removal of temp tables

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