On Dec 5, 2012, at 10:04 AM, Andrew Dunstan <andrew@dunslane.net> wrote:
> Indexing tree-like data isn't at all easy. We don't index XML either. There has been discussion of this sort of
indexingit in the past, and a couple of people have said they would work on it, but I have not seen a proposal or a
singleline of code.
Yeah, I forgot that xmlpath was not indexable.
> Jsonpath on its own would not do what you're suggesting. A first approach to indexing treeish data requires that you
generateall the possible paths and index that. That would be quite explosive in volume. And anyway, jsonpath is not on
offerhere.
Yeah, explosive for sure, but for sufficiently small JSON values, that shouldn’t be much of an issue. I expect GINs to
beexpensive anyway (see full-text indexing).
I am not invested in jsonpath; I just cited it as an example of using a single function call to do a nested search.
Obviously`json_get(json, variadic text)` allows this, too, and could potentially use a GIN index of a JSON tree to
performthe variadic text search at some point in the future, yes?
> I'm sorry what I have offered isn't what you want, but plenty of other people have told me it will go a long way
meetingtheir needs.
*Sigh.* I guess I have not been clear.
The stuff you propose is *awesome*. I love it. The syntax with the chaining operators warms my heart, and I can’t wait
tomake *extensive* use of it in my procedural code. Maybe I would never *need* to do column queries of JSON contents
oftenenough to require an expensive index.
So I'm happy with this stuff, as long as it does not get in the way of supporting indexing at some point in the future.
Ican’t wait to start using it!
Best,
David