jsquery icon indicating copy to clipboard operation
jsquery copied to clipboard

Question: jsquery in order by

Open EliSnow opened this issue 9 years ago • 2 comments

I see how I can use the jsquery @@ operator in a WHERE clause or in a CHECK constraint. Is there an operator in either of the opclasses which would allow the use of the index in an ORDER BY clause? For example, suppose I have a table full of jsonb documents which look like:

{"time":1430432587, "place":"zoo", "animal_counts":{"monkeys":77, "tigers":3, "elephants":9.4}}

I would like to sort by animal_counts.tigers and I would like that sort to use the index.

EliSnow avatar Apr 30 '15 22:04 EliSnow

Unfortunately, that's not possible to this in GIN indexes yet. You could create btree expression index on js->'animal_counts'->'tigers'.

akorotkov avatar Jun 15 '15 15:06 akorotkov

What is the status of VODKA indices making it into Postgres master?

EliSnow avatar Aug 10 '15 21:08 EliSnow