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

Re: Hash Index Build Patch

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Raney <twraney(at)comcast(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Hash Index Build Patch
Date: 2007-09-26 12:49:45
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Hi Tom,

Tom Raney wrote:

> We used spool functions from the BTree code to sort the index
> tuples. Sorting is done on the hash value of the tuples.  The hash
> value depends on the number of primary bucket pages (henceforth
> just bucket pages) that will be required to fit all the index
> tuples. So, before sorting, the base relation is scanned to get
> the total number of tuples.

Just wondering, wouldn't it be enough to obtain a tuple count estimate
by using reltuples / relpages * RelationGetNumberOfBlocks, like the
planner does?

Alvaro Herrera                      
The PostgreSQL Company - Command Prompt, Inc.

In response to


pgsql-patches by date

Next:From: Tom LaneDate: 2007-09-26 18:54:36
Subject: Re: Optimizer hook
Previous:From: Michael MeskesDate: 2007-09-26 10:57:27
Subject: Re: Thread-safe PREPARE in ecpg

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