Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXx9w-00035q-Dl for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Apr 2014 18:23:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WXx9v-000249-Th for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Apr 2014 18:23:39 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXx9u-000241-Oo for pgsql-hackers@postgresql.org; Wed, 09 Apr 2014 18:23:39 +0000 Received: from mail-ig0-x233.google.com ([2607:f8b0:4001:c05::233]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXx9s-0002ov-6m for pgsql-hackers@postgresql.org; Wed, 09 Apr 2014 18:23:38 +0000 Received: by mail-ig0-f179.google.com with SMTP id hl10so2769909igb.6 for ; Wed, 09 Apr 2014 11:23:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=bHIsDE0PwnqEQBIftgq7wA6dgoPZ8ltEG1+n1GH5XBc=; b=TsXv79QgCFI9Ci+3+meMkUBFCLXr1sZsS3ermZKhak6KiDNpUyd0uGJI+QJdLO9B5n ICxP2yMBLBrqub6xknr9lOKsfWHGW249rdIceNaOWhtqKXig01Obo9zTUzzkrHwoGNHl J+A+XGqmGupkTsUV/N/CEmEoc95ywZfm9AC7rm5XrMeNx6sfVWJdGhnK6E9PgfExb1bu nnT6s7v8wVZILMRRMQJ50r7axInIKaXRVwhdOGbmX4BCSE2apmxmzpfj03yDZBEE+o6Y bvorMGd4cxwpwcOWjB+YjHoXPPZHKzGSpjRrpgAvlKbXTnzYO2lzbFmL4jOkLU87iYXa AhFQ== X-Received: by 10.50.62.105 with SMTP id x9mr6178536igr.10.1397067815419; Wed, 09 Apr 2014 11:23:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.23.170 with HTTP; Wed, 9 Apr 2014 11:22:54 -0700 (PDT) In-Reply-To: <30137.1397057056@sss.pgh.pa.us> References: <27299.1396989666@sss.pgh.pa.us> <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> From: Greg Stark Date: Wed, 9 Apr 2014 14:22:54 -0400 X-Google-Sender-Auth: tgKsHF-0w1FgJI7NSL9TBuDLeQc Message-ID: Subject: Re: default opclass for jsonb (was Re: Call for GIST/GIN/SP-GIST opclass documentation) To: Tom Lane Cc: Robert Haas , Heikki Linnakangas , Andrew Dunstan , Peter Geoghegan , "pgsql-hackers@postgresql.org" Content-Type: text/plain; charset=ISO-8859-1 X-Pg-Spam-Score: -1.9 (-) 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 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? -- greg -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers