Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E86EA64FEDB for ; Thu, 4 Sep 2008 23:17:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 66330-06 for ; Thu, 4 Sep 2008 23:17:12 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 0251A64FCF7 for ; Thu, 4 Sep 2008 23:17:12 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m852H8Hp011963; Thu, 4 Sep 2008 22:17:08 -0400 (EDT) To: "Alex Hunsaker" cc: "Zdenek Kotala" , "Xiao Meng" , pgsql-patches@postgresql.org, "Jonah H. Harris" Subject: Re: hash index improving v3 In-reply-to: <34d269d40809041854g355a8f68ga3a037a69e3d9fcb@mail.gmail.com> References: <48BFDA8D.3080506@sun.com> <29987.1220560114@sss.pgh.pa.us> <7627.1220569888@sss.pgh.pa.us> <34d269d40809041742r6a0703dbgfbdd012f7f19de2e@mail.gmail.com> <10995.1220577198@sss.pgh.pa.us> <11525.1220579153@sss.pgh.pa.us> <34d269d40809041854g355a8f68ga3a037a69e3d9fcb@mail.gmail.com> Comments: In-reply-to "Alex Hunsaker" message dated "Thu, 04 Sep 2008 19:54:51 -0600" Date: Thu, 04 Sep 2008 22:17:07 -0400 Message-ID: <11962.1220581027@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/49 X-Sequence-Number: 7064 "Alex Hunsaker" writes: > On Thu, Sep 4, 2008 at 7:45 PM, Tom Lane wrote: >> So what we need for testing is a few different key values that hash to >> the same code. Not sure about an easy way to find such. > Hrm, well I have not really looked at the hash algorithm but I assume > we could just reduce the number of buckets? No, we need fully equal hash keys, else the code won't visit the heap. I guess one thing we could do for testing purposes is lobotomize one of the datatype-specific hash functions. For instance, make int8_hash return the input mod 2^32, ignoring the upper bytes. Then it'd be easy to compute different int8s that hash to the same thing. regards, tom lane