WHERE clause with 40+ conditions - Mailing list pgsql-novice

From DrYSG
Subject WHERE clause with 40+ conditions
Date
Msg-id 1336156311624-5686659.post@n5.nabble.com
Whole thread Raw
Responses Re: WHERE clause with 40+ conditions
Re: WHERE clause with 40+ conditions
List pgsql-novice
My users are presented with a list of checkbox for 4 different attributes
(e.g. type of image, country, etc.)

For type of image they can choose JPG, PNG, JP2000, etc. or turn off the
check box.

My naive implementation would have a WHERE clause with over 40 different
tests (type='JPG' OR type='PNG' OR country='USA' ...)

There has to be an more efficient way to do this (and gives better hints to
the PLANNER).

Suggestions?



--
View this message in context: http://postgresql.1045698.n5.nabble.com/WHERE-clause-with-40-conditions-tp5686659.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Import CSV with Dates & Times
Next
From: Binand Sethumadhavan
Date:
Subject: Re: WHERE clause with 40+ conditions