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

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -