Index creation

From: Yambu <hyambu(at)gmail(dot)com>
To: pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Index creation
Date: 2021-05-24 03:41:41
Message-ID: CALhHtcCO=nBCBRMJfx_s9dGMwPRoH+GmBQSC2X8bGgGLE-OA6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

hello people, I would like to create an index so that the query on here can
use it,

SELECT
*FROM
table_nameWHERE (code_id = 1
OR code_id = 2
OR (code_id = 3
AND created_date < now()))

LIMIT 1;

please advise me on how I should create index. I created index on code_id
but it's not being used

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David Rowley 2021-05-24 04:00:17 Re: Index creation
Previous Message Bo Guo 2021-05-23 02:36:52 Re: Getting transaction details from the WAL?