Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WilFI-00014M-D6 for pgsql-hackers@arkaria.postgresql.org; Fri, 09 May 2014 13:53:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WilFH-0001TY-RG for pgsql-hackers@arkaria.postgresql.org; Fri, 09 May 2014 13:53:51 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WilFG-0001Rb-2z for pgsql-hackers@postgresql.org; Fri, 09 May 2014 13:53:50 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WilFC-000341-L0 for pgsql-hackers@postgresql.org; Fri, 09 May 2014 13:53:49 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1WilF2-00069t-6R; Fri, 09 May 2014 09:53:36 -0400 Date: Fri, 9 May 2014 09:53:36 -0400 From: Bruce Momjian To: Tom Lane Cc: Gavin Flower , "David E. Wheeler" , Greg Stark , Robert Haas , Heikki Linnakangas , Andrew Dunstan , Peter Geoghegan , "pgsql-hackers@postgresql.org" Subject: Re: default opclass for jsonb (was Re: Call for GIST/GIN/SP-GIST opclass documentation) Message-ID: <20140509135336.GC23254@momjian.us> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18360.1399633457@sss.pgh.pa.us> 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 Fri, May 9, 2014 at 07:04:17AM -0400, Tom Lane wrote: > Gavin Flower writes: > > On 09/05/14 15:34, Bruce Momjian wrote: > >> Looks good. I was thinking the jsonb_ops name could remain unchanged > >> and the jsonb_hash_ops could be called jsonb_combo_ops as it combines > >> the key and value into a single index entry. > > > If you have 'jsonb_combo_ops' - then surely 'jsonb_op' should be called > > 'jsonb_xxx_ops', where the 'xxx' distinguishes that from > > 'jsonb_combo_ops'? I guess, if any appropriate wording of 'xxx' was too > > cumbersome, then it would be worse. > > Yeah, I'm disinclined to change the opclass names now. It's not apparent > to me that "combo" is a better choice than "hash" for the second opclass. Well, if we are optionally hashing json_ops for long strings, what does jsonb_hash_ops do uniquely with hashing? Does it always hash, while json_ops optionally hashes? Is that the distinguishing characteristic? It seemed the _content_ of the indexed value was more important, rather than the storage method. Should jsonb_hash_ops do only optional hashing too for long strings? Also, with json_ops, when you index '{"exterior" : "white", "interior": "blue"}', if you query for {"exterior" : "blue"}, does it match and have to be rechecked in the heap because the index doesn't know which values go with which keys? -- 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