Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXdqg-00082j-E3 for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Apr 2014 21:46:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WXdqf-0003lt-So for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Apr 2014 21:46:29 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXdqd-0003jh-KC for pgsql-hackers@postgresql.org; Tue, 08 Apr 2014 21:46:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXdqa-0005wt-Sj for pgsql-hackers@postgresql.org; Tue, 08 Apr 2014 21:46:27 +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 s38LkMFi029031; Tue, 8 Apr 2014 17:46:22 -0400 From: Tom Lane To: Peter Geoghegan cc: pgsql-hackers@postgresql.org Subject: default opclass for jsonb (was Re: Call for GIST/GIN/SP-GIST opclass documentation) In-reply-to: References: <27299.1396989666@sss.pgh.pa.us> <28589.1396992841@sss.pgh.pa.us> Comments: In-reply-to Peter Geoghegan message dated "Tue, 08 Apr 2014 14:39:29 -0700" Date: Tue, 08 Apr 2014 17:46:22 -0400 Message-ID: <29030.1396993582@sss.pgh.pa.us> X-Pg-Spam-Score: -2.2 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Peter Geoghegan writes: > On Tue, Apr 8, 2014 at 2:34 PM, Tom Lane wrote: >> (BTW, wasn't there some discussion of changing our minds about which >> one is the default? We already have one bug report complaining about >> jsonb_ops' size restriction, so that seems to be evidence in favor >> of changing ...) > Yes, there was. I very nearly came down on the side of making > jsonb_hash_ops the default, but given that it doesn't make all > operators indexable, I ultimately decided against supporting that > course of action. I thought that that would be an odd limitation for > the default GIN opclass to have. It was a very close call in my mind, > and if you favor changing the default now, in light of the few > complaints we've heard, I think that's a reasonable decision. That > said, as I noted in the main -bugs thread, the case presented is > fairly atypical. Well, let me see if I understand the situation correctly: * jsonb_ops supports more operators * jsonb_hash_ops produces smaller, better-performing indexes * jsonb_ops falls over on inputs with wide field values, but jsonb_hash_ops does not If that's an accurate summary then I would say that we've got the default backwards. I would much rather tell people "you can have more operators supported, but here are the tradeoffs" than have a default that fails under evidently-not-so-improbable cases. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers