Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WjJDC-00062W-Q0 for pgsql-hackers@arkaria.postgresql.org; Sun, 11 May 2014 02:09:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WjJDC-0005Ck-3B for pgsql-hackers@arkaria.postgresql.org; Sun, 11 May 2014 02:09:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WjJDA-0005Ca-O3 for pgsql-hackers@postgresql.org; Sun, 11 May 2014 02:09:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WjJD8-0003Qh-4N for pgsql-hackers@postgresql.org; Sun, 11 May 2014 02:09:56 +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 s4B29ciB006663; Sat, 10 May 2014 22:09:38 -0400 From: Tom Lane To: Peter Geoghegan cc: Heikki Linnakangas , Greg Stark , Bruce Momjian , Gavin Flower , "David E. Wheeler" , Robert Haas , Andrew Dunstan , "pgsql-hackers@postgresql.org" Subject: Re: default opclass for jsonb (was Re: Call for GIST/GIN/SP-GIST opclass documentation) In-reply-to: References: <16769.1399407530@sss.pgh.pa.us> <20140506212020.GK30817@momjian.us> <57E8AA44-F816-45F2-BB61-5A854FFB0A97@justatheory.com> <28554.1399414853@sss.pgh.pa.us> <20140508134701.GO30817@momjian.us> <5819.1399558614@sss.pgh.pa.us> <1888.1399588751@sss.pgh.pa.us> <20140509033405.GA23254@momjian.us> <536C550F.50108@archidevsys.co.nz> <18360.1399633457@sss.pgh.pa.us> <20140509135336.GC23254@momjian.us> <28961.1399668272@sss.pgh.pa.us> <536E8F3A.40706@vmware.com> <4986.1399769673@sss.pgh.pa.us> Comments: In-reply-to Peter Geoghegan message dated "Sat, 10 May 2014 18:31:35 -0700" Date: Sat, 10 May 2014 22:09:38 -0400 Message-ID: <6662.1399774178@sss.pgh.pa.us> 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 Peter Geoghegan writes: > On Sat, May 10, 2014 at 5:54 PM, Tom Lane wrote: >> + especially if >> + there are a very large number of rows containing any single one of the >> + three keys > I suggest that you phrase this as "three index items". Good idea --- "key" is overloaded in this discussion. I'd meant to use "item" uniformly for the index entries, but missed some spots. >> + A disadvantage of the jsonb_path_ops approach is >> + that it produces no index entries for JSON structures not containing >> + any values, such as {"a": {}}. If a search for > I suggest "any values or elements". Meh --- the previous para is also using "value" to include array elements, and I don't see anything in RFC 7159 suggesting that that's not preferred terminology. But I added a footnote to clarify: The technical difference between a jsonb_ops and a jsonb_path_ops GIN index is that the former creates independent index items for each key and value in the data, while the latter creates index items only for each value in the data.For this purpose, the term value includes array elements, though JSON terminology sometimes considers array elements distinct from values within objects. > Even though I previously called hashing an implementation detail, we > are bound to have to mention it in passing when discussing the > limitations of jsonb_hash_ops/jsonb_path_ops. I think that you should > proceed with committing the entire patch, including the doc changes > that discuss implementation details around the two GIN opclasses. I'll hold off committing till the morning to see if there are objections. 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