Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WcjF1-0004fH-Ow for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Apr 2014 22:32:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WcjF1-0000RE-2t for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Apr 2014 22:32:39 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WcjEz-0000R5-GV for pgsql-hackers@postgresql.org; Tue, 22 Apr 2014 22:32:37 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WcjEw-0002aR-NO for pgsql-hackers@postgresql.org; Tue, 22 Apr 2014 22:32:36 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1WcjEs-0005W3-UZ; Tue, 22 Apr 2014 18:32:30 -0400 Date: Tue, 22 Apr 2014 18:32:30 -0400 From: Bruce Momjian To: Greg Stark Cc: Tom Lane , Robert Haas , Heikki Linnakangas , Andrew Dunstan , Peter Geoghegan , "pgsql-hackers@postgresql.org" Subject: Re: Re: default opclass for jsonb (was Re: Call for GIST/GIN/SP-GIST opclass documentation) Message-ID: <20140422223230.GL10046@momjian.us> References: <28589.1396992841@sss.pgh.pa.us> <29030.1396993582@sss.pgh.pa.us> <534475B7.6020908@dunslane.net> <5344EAA4.1050605@vmware.com> <30137.1397057056@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -2.6 (--) 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 On Wed, Apr 9, 2014 at 02:22:54PM -0400, Greg Stark wrote: > On Wed, Apr 9, 2014 at 11:24 AM, Tom Lane wrote: > >> Maybe we should make *neither* of these the default opclass, and give > >> *neither* the name json_ops. > > > > There's definitely something to be said for that. Default opclasses are > > sensible when there's basically only one behavior that's interesting for > > most people. We can already see that that's not going to be the case > > for jsonb indexes, at least not with the currently available alternatives. > > > > Not having a default would force users to make decisions explicitly. > > Is that what we want? > > I don't like the idea of having no default opclass. I think there's a > huge usability gain in being able to "just" create an index on a > column and have it do something reasonable for most use cases. > > I can get behind the idea of having separate index opclasses for paths > and path-value pairs but I suspect the default should just be to index > both in the same index. If we can have one default index opclass that > supports containment and existence and then other opclasses that are > smaller but only support a subset of the operators that would seem > like the best compromise. > > I'm a bit confused by Heikki's list though. I would expect path and > path-value pair to be the only useful ones. I'm not clear what an > index on keys or key-value would be -- it would index just the > top-level keys and values without recursing? Where are we on the default JSONB opclass change? -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. + -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers