ORDER BY for jsonb

Поиск
Список
Период
Сортировка
От Pai-Hung Chen
Тема ORDER BY for jsonb
Дата
Msg-id CAMwtcTywugA3EHJ6Jr_Dsf-e7+-S7U785urxEtD5V0n=bew7kw@mail.gmail.com
обсуждение исходный текст
Ответы Re: ORDER BY for jsonb  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список pgsql-general
Hi,

I am new to PostgreSQL and have a question about the new jsonb type in 9.4. Suppose I have a table called "user" that has two columns: (1) "user_id" of type text, also the primary key, (2) "setting" of type jsonb. With the following query pattern:

SELECT *
FROM user
WHERE user_id IN [...]
ORDER BY setting->>'foo',
         setting->>'bar',
         ...

where ORDER BY clause can contain an arbitrary list of root-level fields in "setting". In this case, how should I create indexes for "user" to get good query performance? 

Thanks,
Pai-Hung

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

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: Waiting on ExclusiveLock on extension
Следующее
От: Jim Nasby
Дата:
Сообщение: Re: ORDER BY for jsonb