Skip to content

Question: jsquery in order by #10

Open

Description

@EliSnow

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.

Activity

  1. akorotkov commented on Jun 15, 2015

    @akorotkov
    Contributor

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

  2. EliSnow commented on Aug 10, 2015

    @EliSnow
    Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions