Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXnlQ-0004fR-RM for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Apr 2014 08:21:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WXnlQ-00070V-AX for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Apr 2014 08:21:44 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXnlO-00070M-Ut for pgsql-hackers@postgresql.org; Wed, 09 Apr 2014 08:21:43 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXnlH-0000WW-7W for pgsql-hackers@postgresql.org; Wed, 09 Apr 2014 08:21:41 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 24DD628539; Wed, 9 Apr 2014 01:21:33 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 144391807F; Wed, 9 Apr 2014 01:21:33 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 6640F12002A; Wed, 9 Apr 2014 01:21:26 -0700 (PDT) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Wed, 9 Apr 2014 01:21:25 -0700 (PDT) Message-ID: <53450306.8040104@vmware.com> Date: Wed, 09 Apr 2014 11:21:26 +0300 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.4.0 MIME-Version: 1.0 To: Peter Geoghegan CC: Andrew Dunstan , Tom Lane , pgsql-hackers@postgresql.org Subject: Re: default opclass for jsonb (was Re: Call for GIST/GIN/SP-GIST opclass documentation) 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> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.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 On 04/09/2014 10:40 AM, Peter Geoghegan wrote: > On Tue, Apr 8, 2014 at 11:37 PM, Heikki Linnakangas > wrote: >> As the code stands, you don't have a choice on any of those things. The >> decisions have been made by us, PostgreSQL developers. The only choice you >> have is between jsonb_ops and jsonb_hash_ops, with a strange combination of >> tradeoffs in both. Sure, they're still useful, if not optimal, for a >> wide-range of applications. For more complicated cases, you will have to >> resort to expression indexes. It bugs me greatly that the underlying indexam >> could do all those things, we're just not exposing the capability. > > Why would you ever not have to use expression indexes? Idiomatic usage > of jsonb involves expression indexes because it's desirable to index > only a expression. People will want to do things like only index the > nested "tags" array far more frequently then they'll only want to > index keys (that is, Object pair keys) in the entire document. I don't > get why you'd say that they'd "resort" to expression indexes, like > they're a kludge. Expression indexes are definitely nice, but you have to be careful to formulate the query in exactly the same way to match the index. > Have you ever tried out one of the new document > databases? I suggest you do. Expression indexes on jsonb map pretty > closely onto how you're frequently expected to index data in those > systems. That's something that they make heavy use of. Why would you > ever not really have to consider ahead of time what is important > enough to be indexed, and what is not? I didn't say that. On the contrary, I think the shotgun approach jsonb_ops and jsonb_hash_ops take is too broad. It should be possible to specify what to index in a more detailed fashion. - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers