Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wic8c-0000On-AX for pgsql-hackers@arkaria.postgresql.org; Fri, 09 May 2014 04:10:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wic8b-00049Z-Ox for pgsql-hackers@arkaria.postgresql.org; Fri, 09 May 2014 04:10:21 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wic8a-00049A-7y for pgsql-hackers@postgresql.org; Fri, 09 May 2014 04:10:20 +0000 Received: from mbx.knossos.net.nz ([202.160.48.10]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wic8W-0001QF-17 for pgsql-hackers@postgresql.org; Fri, 09 May 2014 04:10:19 +0000 Received: from [10.1.1.3] (121-99-186-100.bng1.nct.orcon.net.nz [121.99.186.100]) (authenticated bits=0) by mbx.knossos.net.nz (8.14.4/8.14.4) with ESMTP id s4949ptE024335 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 9 May 2014 16:09:51 +1200 Message-ID: <536C550F.50108@archidevsys.co.nz> Date: Fri, 09 May 2014 16:09:51 +1200 From: Gavin Flower Organization: ArchiDevSys User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Bruce Momjian , Tom Lane CC: "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) References: <20140422223230.GL10046@momjian.us> <16527.1398214220@sss.pgh.pa.us> <20140506201048.GI30817@momjian.us> <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> In-Reply-To: <20140509033405.GA23254@momjian.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 09/05/14 15:34, Bruce Momjian wrote: > On Thu, May 8, 2014 at 06:39:11PM -0400, Tom Lane wrote: >> I wrote: >>> I think the idea of hashing only keys/values that are "too long" is a >>> reasonable compromise. I've not finished coding it (because I keep >>> getting distracted by other problems in the code :-() but it does not >>> look to be very difficult. I'm envisioning the cutoff as being something >>> like 128 bytes; in practice that would mean that few if any keys get >>> hashed, I think. >> Attached is a draft patch for this. In addition to the hash logic per se, >> I made these changes: >> >> * Replaced the K/V prefix bytes with a code that distinguishes the types >> of JSON values. While this is not of any huge significance for the >> current index search operators, it's basically free to store the info, >> so I think we should do it for possible future use. >> >> * Fixed the problem with "exists" returning rows it shouldn't. I >> concluded that the best fix is just to force recheck for exists, which >> allows considerable simplification in the consistent functions. >> >> * Tried to improve the comments in jsonb_gin.c. >> >> Barring objections I'll commit this tomorrow, and also try to improve the >> user-facing documentation about the jsonb opclasses. > 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. Cheers, Gavin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers