Performance on JSONB select - Mailing list pgsql-general

From PegoraroF10
Subject Performance on JSONB select
Date
Msg-id 1570027063947-0.post@n3.nabble.com
Whole thread Raw
Responses Re: Performance on JSONB select
List 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 by date:

Previous
From: Evelyn Dibben
Date:
Subject: Questions about Partitioned Tables and Indexes
Next
From: Jason Ralph
Date:
Subject: PG11 Parallel Thanks!!