database - Designing an index for a postgres query -
we have query retrieves data master-detail simple schema. where clause looks like:
-- these random numbers ticket.type_id in ( 2, 3, 4, 5, 7 ) , ( ticket.color_id null or ticket.color_id in ( 1, 2 , 8 ) ) we have indexes in columns: ticket.type_id , ticket.color_id, anyway query explain analyze still show postgresql making sequential scan satisfy query.
this query important , recurrent in system, want create index specially case.
what index solve case?
not real sure - think null getting yuo..
maybe oddball looking structure this
where ticket.type_id in ( 2, 3, 4, 5, 7 ) , ( nvl(ticket.color_id,1) in ( 1, 2 , 8 ) )
Comments
Post a Comment