Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xLgqd-00000001du2-2wR6 for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Oct 2026 13:04:17 +0000 Received: from localhost ([127.0.0.1]:51776 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xLgqc-0000000AVIe-3RDL for pgsql-hackers@arkaria.postgresql.org; Tue, 27 Oct 2026 13:04:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:43680) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xLgqc-0000000AVIV-1DVU for pgsql-hackers@lists.postgresql.org; Tue, 27 Oct 2026 13:04:14 +0000 Received: from mail-10625.protonmail.ch ([79.135.106.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xLgqZ-00000001ElD-2lCo for pgsql-hackers@postgresql.org; Tue, 27 Oct 2026 13:04:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burd.me; s=protonmail; t=1793106249; x=1793365449; bh=4/gcvnd1z3vvrlC2Q5yfndnrpr+pSDsJBEgz7CU7A6Q=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=kROcJdLjtMfvuVuCAqgpdZ5oLA8fBDogtzATqKAunhzJW4nJ79G3Zl9dn9ktmDy0a VZGCqv1WMbhU7sWPctGUi+B8tQJPh8qLbW1LPNglB9SC4WnSmKWKMw0XQkIj/D6zup q6CZI813fVYuupeX75EdjUMa7njPufAWb7ptAusFUcLHAtXoGs2aZukSK0/f2C6vYr jeU+Qp7WZUQytjQhzEq3zWxarK/cPIU0xDi3j+yeZSxse6kKRdz1cKxNj6q2gIpoTE 1Thkr/4sQQ+TieJuOPv47bF/r/TIdR8doyU8Vlthuj5kp3xytgxF+LS7POy7UrsWdx UlUylFs+PtTJw== Date: Tue, 27 Oct 2026 13:04:03 +0000 To: pgsql-hackers@postgresql.org From: Greg Burd Cc: zhong950419@gmail.com, andres@anarazel.de, greg@burd.me, michael@paquier.xyz, pgsql@j-davis.com, thomas.munro@gmail.com, exclusion@gmail.com, amit.kapila16@gmail.com, hlinnaka@iki.fi Subject: Re: WAL record CRC calculated incorrectly because of underlying buffer modification Message-ID: In-Reply-To: References: <12CB9268-9A1C-4555-96BB-E3EA01B14C0F@anarazel.de> Feedback-ID: 2668248:user:proton X-Pm-Message-ID: ebe67727be8e4be2627af9d877b920925a45f720 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 26 Oct 2026 14:08:29 -0400, shihao zhong wr= ote: > Hi Andres and Greg, >=20 > > I think they're almost unused and don't offer enough advantage over btr= ee >=20 > I largely agree with this. In my experience, B-tree accounts for 95%+ of > indexes, and all other access methods combined make up only a > small fraction. But I do see quite a few hash index users. While I agree that the vast majority of users rightly default to the BTREE index I don't find that a compelling reason to drop HASH. I see that as a challenge, maybe HASH isn't used because it is not as well maintained as BTREE and needs some attention [0]? > > we should have just ripped them out. >=20 > I have mixed feelings on this. I think this would invite further specialization of code outside nbtree into shapes that only support nbtree reducing the ability to innovate with other table and index AMs. Sure there is GIN, GiST, BRIN, etc. but IMO hash represents a quadrant of access patterns that we should support, and our code there today isn't inspiring many to give it a look even for use cases that fit that pattern well. That's a signal to innovate, not remove code. We have this issue today with HEAP, because we only have one table AM in core things are simpler to maintain but it is also easier for heap-isms to leak outside the table AM boundaries in the name of performance or other goals. IMO this is a long-term philosophical question for Postgres; is it extensible or is it highly opinionated and specialized? > On one hand, hash is probably the least used > "general-purpose" index since its use case overlaps directly with B-tree, > whereas GiST, SP-GiST, and BRIN exist for specialized data types or acces= s > patterns that B-tree can't handle. On the other hand, in practice I still > see hash indexes used at least as often as GiST, BRIN, or SP-GiST. >=20 > I suspect part of the low adoption is historical baggage from being > unlogged prior to old version, which gave hash indexes a bad reputation i= n > the community, it also miss some features for general OLTP workloads >=20 > I feel there is plenty of room for improvement there. I agree that there is historical baggage, performance, and possibly simple knowledge gaps that push the adoption toward BTREE. > > The advantage hash does have, i.e. large key handling, would have bette= r > > been addressed by adding support to transparently btree indexing a hash > > of the key + recheck. >=20 > That's an interesting point. But I think users can do that today with > expression index right? Expression indexes prevent HOT updates, so maybe you could but at what cost? > Thanks, > Shihao best. -greg