From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Stefan Keller <sfkeller(at)gmail(dot)com> |
Cc: | Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>, pgsql-general List <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: hstore equality-index performance question |
Date: | 2010-03-30 15:43:53 |
Message-ID: | 24160.1269963833@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Stefan Keller <sfkeller(at)gmail(dot)com> writes:
> I'm trying to optimize the latter query:
> # SELECT id, (kvp->'a') FROM mytable WHERE kvp ? 'a';
The hstore gist and gin opclasses contain support for that.
> ...or something like this (which also involves the '->' operator)
> # SELECT id FROM mytable WHERE (kvp->'a') = 'x';
You could transform this into a gist/gin indexable query
kvp @> ('a' => 'x')
although I think the actually indexed part of it is just the search for
rows that contain key 'a', so it's not really any better than
kvp ? 'a' AND (kvp->'a') = 'x'
performance-wise.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Andy Colson | 2010-03-30 15:46:11 | Re: User action accounting |
Previous Message | Stefan Keller | 2010-03-30 15:27:17 | Re: hstore equality-index performance question |