Re: default opclass for jsonb (was Re: Call for GIST/GIN/SP-GIST opclass documentation) - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: default opclass for jsonb (was Re: Call for GIST/GIN/SP-GIST opclass documentation)
Date
Msg-id 20140508143404.GP30817@momjian.us
Whole thread Raw
In response to Re: default opclass for jsonb (was Re: Call for GIST/GIN/SP-GIST opclass documentation)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: default opclass for jsonb (was Re: Call for GIST/GIN/SP-GIST opclass documentation)
List pgsql-hackers
On Thu, May  8, 2014 at 10:16:54AM -0400, Tom Lane wrote:
> > Can we hash just the values, not the keys, in jsonb_ops, and hash the
> > combo in jsonb_hash_ops.  That would give us key-only lookups without a
> > recheck.
> 
> No, because there's nothing in JSON limiting the length of keys, any more
> than values.
> 
> 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.

Yes, that would be nice.  Ideally we would not be doing this so close to
beta, but it is what it is, and if we need to break binary compatibility
after beta1, at least we have pg_upgrade.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + Everyone has their own god. +



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [v9.5] Custom Plan API
Next
From: Andres Freund
Date:
Subject: Re: default opclass for jsonb (was Re: Call for GIST/GIN/SP-GIST opclass documentation)