Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bGE7O-0002B6-Kl for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Jun 2016 23:33:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bGE7N-000771-Ki for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Jun 2016 23:33:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bGE6k-0006Q7-Mo for pgsql-bugs@postgresql.org; Thu, 23 Jun 2016 23:32:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bGE6i-0001B4-5L for pgsql-bugs@postgresql.org; Thu, 23 Jun 2016 23:32:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u5NNWL5g012195; Thu, 23 Jun 2016 19:32:21 -0400 From: Tom Lane To: Robert Haas cc: Daniel Newman , danielnewman@umich.edu, pgsql-bugs@postgresql.org Subject: Re: BUG #14210: filter by "=" constraint doesn't work when hash index is present on a column In-reply-to: <10331.1466723337@sss.pgh.pa.us> References: <20160623162507.17237.39471@wrigleys.postgresql.org> <30648.1466701447@sss.pgh.pa.us> <10331.1466723337@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 23 Jun 2016 19:08:57 -0400" Date: Thu, 23 Jun 2016 19:32:21 -0400 Message-ID: <12194.1466724741@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org I wrote: > So the answer is that this got broken by commit 9f03ca915196dfc8, > which appears to have imagined that _hash_form_tuple() is just an > alias for index_form_tuple(). But it ain't. As a result, construction > of hash indexes larger than shared_buffers is broken in 9.5 and up: BTW, an easy way to prove that the _h_spool code path is broken is to do this: diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index 49a6c81..162cb63 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -125,7 +125,7 @@ hashbuild(Relation heap, Relation index, IndexInfo *indexInfo) * NOTE: this test will need adjustment if a bucket is ever different from * one page. */ - if (num_buckets >= (uint32) NBuffers) + if (1) buildstate.spool = _h_spoolinit(heap, index, num_buckets); else buildstate.spool = NULL; and then run the regression tests. I'm thinking it would be a good idea to provide some less-painful way to force that code path to be taken for testing purposes. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs