Performance on JSONB select

Поиск
Список
Период
Сортировка
От PegoraroF10
Тема Performance on JSONB select
Дата
Msg-id 1570027063947-0.post@n3.nabble.com
обсуждение исходный текст
Ответы Re: Performance on JSONB select  (Michael Lewis <mlewis@entrata.com>)
Список pgsql-general
select * from MyTable where
  ((JsonBField->>'status'='descartada' and
To_Date(JsonBField->'descartada'->>'data','yyyy-mm-dd') > Current_Date) or
   (JsonBField->>'status'='contrato' and
To_Date(JsonBField->'contrato'->>'data','yyyy-mm-dd') > Current_Date-7) or
   (JsonBField->>'status'='naoatribuido'));

Considering this table has a million records, I would like to use a proper
index, but how can I use an index when using operator >. 




--
Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html



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

Предыдущее
От: Evelyn Dibben
Дата:
Сообщение: Questions about Partitioned Tables and Indexes
Следующее
От: Jason Ralph
Дата:
Сообщение: PG11 Parallel Thanks!!