Re: JSON Indexes

Поиск
Список
Период
Сортировка
От Vik Fearing
Тема Re: JSON Indexes
Дата
Msg-id 53A9EACB.8000604@dalibo.com
обсуждение исходный текст
Ответ на JSON Indexes  (CS_DBA <cs_dba@consistentstate.com>)
Список pgsql-general
On 06/24/2014 10:15 PM, CS_DBA wrote:
> I added a PK constraint on the id column and created this json index:
>
> create index mytest_json_col_idx on mytest ((task->'name'));
>
> However the planner never uses the index...
>
>
> EXPLAIN SELECT (mytest.task->>'name') as name,
>
> COUNT((mytest.task->>'name')) AS task_count
>
> FROM mytest
>
> GROUP BY (mytest.task->>'name')
>
> ORDER BY 2  DESC;
>
>
> Am I missing something?

Yes, you're querying task->>'name' but the index is on task->'name'.
--
Vik


В списке pgsql-general по дате отправления:

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: JSON Indexes
Следующее
От: Patrick Krecker
Дата:
Сообщение: Getting "cache lookup failed for aggregate" error