That query would be this:
SELECT json_field FROM data WHERE json_field->'age' > 15
Part of the performance increase for hstore is improvements for GIN indexes, and according to the author can be applied to json. So yes you can use indexes on your hstore or json documents.
Re:Hstore development for 9.4 release
by andreypopp on Thursday November 07, 2013 @10:38AM
(#6689914)
Yes, this is what index scan performance metrics is about — PostgreSQL outperforms MongoDB here.
This is how you do it in 9.2 using PLV8.
http://people.planetpostgresql.org/andrew/index.php?/archive...
For 9.3, see more info at http://michael.otacoo.com/postgresql-2/postgres-9-3-feature-...
Re:Hstore development for 9.4 release
by jeffasinger on Thursday November 07, 2013 @12:18PM
(#6690660)
Yes, for a project I'm working on, I had a JSON array of objects that each had a key called name.
I have fast indexed queries that return any rows that have an object with a given name in it, and for full text search on that name along with a few other things.
Re:Hstore development for 9.4 release
by chrisfarms on Thursday November 07, 2013 @10:40AM
(#6689926)
yes. See the operators at:
http://www.postgresql.org/docs/9.3/static/functions-json.htm...
I.e. can I do something like SELECT json_field FROM data WHERE json_field.age > 15 ?