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

pgsql: Change hash indexes to store only the hash code rather than the

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Change hash indexes to store only the hash code rather than the
Date: 2008-09-15 18:43:41
Message-ID: 20080915184341.D83697545A4@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Change hash indexes to store only the hash code rather than the whole indexed
value.  This means that hash index lookups are always lossy and have to be
rechecked when the heap is visited; however, the gain in index compactness
outweighs this when the indexed values are wide.  Also, we only need to
perform datatype comparisons when the hash codes match exactly, rather than
for every entry in the hash bucket; so it could also win for datatypes that
have expensive comparison functions.  A small additional win is gained by
keeping hash index pages sorted by hash code and using binary search to reduce
the number of index tuples we have to look at.

Xiao Meng

This commit also incorporates Zdenek Kotala's patch to isolate hash metapages
and hash bitmaps a bit better from the page header datastructures.

Modified Files:
--------------
    pgsql/doc/src/sgml:
        catalogs.sgml (r2.173 -> r2.174)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/catalogs.sgml?r1=2.173&r2=2.174)
    pgsql/src/backend/access/hash:
        hash.c (r1.104 -> r1.105)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/hash/hash.c?r1=1.104&r2=1.105)
        hashinsert.c (r1.50 -> r1.51)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/hash/hashinsert.c?r1=1.50&r2=1.51)
        hashovfl.c (r1.64 -> r1.65)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/hash/hashovfl.c?r1=1.64&r2=1.65)
        hashpage.c (r1.76 -> r1.77)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/hash/hashpage.c?r1=1.76&r2=1.77)
        hashsearch.c (r1.53 -> r1.54)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/hash/hashsearch.c?r1=1.53&r2=1.54)
        hashutil.c (r1.56 -> r1.57)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/hash/hashutil.c?r1=1.56&r2=1.57)
    pgsql/src/backend/catalog:
        index.c (r1.303 -> r1.304)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/index.c?r1=1.303&r2=1.304)
    pgsql/src/backend/utils/sort:
        tuplesort.c (r1.86 -> r1.87)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/sort/tuplesort.c?r1=1.86&r2=1.87)
    pgsql/src/include/access:
        hash.h (r1.89 -> r1.90)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/hash.h?r1=1.89&r2=1.90)
    pgsql/src/include/catalog:
        catversion.h (r1.485 -> r1.486)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/catversion.h?r1=1.485&r2=1.486)
        pg_am.h (r1.57 -> r1.58)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_am.h?r1=1.57&r2=1.58)
        pg_opclass.h (r1.82 -> r1.83)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_opclass.h?r1=1.82&r2=1.83)

pgsql-committers by date

Next:From: Magnus HaganderDate: 2008-09-15 20:55:04
Subject: pgsql: Fix error messages from recent pg_hba parsing patch to use
Previous:From: User KostasDate: 2008-09-15 13:49:11
Subject: pgtreelib - pgtreelib: set_root

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