Fwiw I have a few questions -- but beware, I'm a complete neophyte when it comes to jsonb style document databases so these are more likely to represent misconceptions on my part than problems with jsonb.
I naively though a gin index on a jsonb would help with queries like WHERE col->'prop' = 'val'. In fact it only seems to help with WHERE col ? 'prop'. To help with the former it looks like I need an expression index on col->'prop' is that right? There doesn't seem to be an operator that combines both a dereference and value test into a single operator so I don't think our index machinery can deal with this. Or am I supposed to use contains and construct a json object for the test? I also find it awkward that col->>'prop' returns the json representation of the property. If it's text that means it's double-quoted. I would think that a user storing text in a json property would want a way to pull out the text that json property represents so he doesn't have to write col->>'prop' = '"foo"' and doesn't need to strip the quotes (and de-escape the string?) before displaying the value or passing it through other apis. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers