Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXuEf-0005Il-Lx for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Apr 2014 15:16:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WXuEf-0002fE-4S for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Apr 2014 15:16:21 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXuEc-0002d1-OV for pgsql-hackers@postgresql.org; Wed, 09 Apr 2014 15:16:18 +0000 Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WXuEZ-0007sN-LM for pgsql-hackers@postgresql.org; Wed, 09 Apr 2014 15:16:18 +0000 Received: by mail-wi0-f179.google.com with SMTP id z2so3419632wiv.0 for ; Wed, 09 Apr 2014 08:16:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=NOAZDnNPsoFGhn904lB/rRNd9dtUTiFK8shQqO08G9U=; b=N/k8VgQfAGk8A8m+Ag6XQZMhN1uc0W5HPimbQrXsPUe7HDkcHVOmX3LhhrAuWi1U/V 5+veIBQRqNmx/c1h0Iu6p8gUPfKCmYrr1k8HAZs4FI3Dh6otlTUpz+f7BH6ojptxZKjY 0vFb6m1Uhe6X9W/AIf2tvzJ/xeoCXNyKsNnT0jc7I64iE53b0g4Q2s5+YRoknxX0ExHn TCteV97izuEWK2Oa3VGejKu6DfOeWAgdlGkrjN5glklR8sBDruR8zuwD3wFVOJAfRDgR GN3MSuf40aBpNZ0UAW+2N74MJ/bAEYE8Y/Un8iKXiPIA3p6nTVtkGKJviapOEVlzb/hK DwRg== MIME-Version: 1.0 X-Received: by 10.194.21.193 with SMTP id x1mr10043210wje.33.1397056573698; Wed, 09 Apr 2014 08:16:13 -0700 (PDT) Received: by 10.227.235.79 with HTTP; Wed, 9 Apr 2014 08:16:13 -0700 (PDT) In-Reply-To: <5344EAA4.1050605@vmware.com> 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> Date: Wed, 9 Apr 2014 11:16:13 -0400 Message-ID: Subject: Re: default opclass for jsonb (was Re: Call for GIST/GIN/SP-GIST opclass documentation) From: Robert Haas To: Heikki Linnakangas Cc: Andrew Dunstan , Peter Geoghegan , Tom Lane , "pgsql-hackers@postgresql.org" Content-Type: text/plain; charset=ISO-8859-1 X-Pg-Spam-Score: -2.0 (--) 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 2:37 AM, Heikki Linnakangas wrote: > Both of the operator classes are actually much less flexible than I'd like. > Firstly, they index everything. In many cases, that's not what you want, so > you end up with much larger indexes than necessary. Secondly, jsonb_ops > indexes all values separately from the keys. That makes the index pretty > much useless for a query on, say, WHERE json @> '{"needs_processing":true}', > if all the rows also contain a key-value pair "active":true. Thirdly, > inequality operators are not supported; you can't search for rows with (the > json-syntax equivalent of) "price < 12.3". Fourthly, sometimes you would > want to include the "path" to an entry in the key, sometimes not. Maybe we should make *neither* of these the default opclass, and give *neither* the name json_ops. > ISTM we need a way to parameterize opclasses, so that when you create the > index, you specify the above things. Yeah, that would be great. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers