Re: Hash Index Build Patch - Mailing list pgsql-patches

From Alvaro Herrera
Subject Re: Hash Index Build Patch
Date
Msg-id 20070926124945.GE5584@alvh.no-ip.org
Whole thread Raw
In response to Hash Index Build Patch  (Tom Raney <twraney@comcast.net>)
Responses Re: Hash Index Build Patch  (Tom Raney <twraney@comcast.net>)
List 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                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-patches by date:

Previous
From: Michael Meskes
Date:
Subject: Re: Thread-safe PREPARE in ecpg
Next
From: Tom Lane
Date:
Subject: Re: Optimizer hook