Re: Very long "or" where clause - Mailing list pgsql-general

From Richard Huxton
Subject Re: Very long "or" where clause
Date
Msg-id 45ACA3CB.4070503@archonet.com
Whole thread Raw
In response to Re: Very long "or" where clause  (Scara Maccai <m_lists@yahoo.it>)
List pgsql-general
Scara Maccai wrote:
>> Put the test-values into a temporary table, analyse it and then join
>> against it.
>
> Ok, I didn't think of it.
>
>> Can't say about indexes without knowing more about your usage pattern.
>
>
> What do you mean?

You might want an index on time, id, (id,time) or (time,id) - depends on
how many OR clauses there are typically and how many distinct values
there are for "time" and "id".

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Scara Maccai
Date:
Subject: Re: Very long "or" where clause
Next
From: Max Ueda
Date:
Subject: Coercion in PGSQL?