Re: Very long "or" where clause

From: Richard Huxton <dev(at)archonet(dot)com>
To: Scara Maccai <m_lists(at)yahoo(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Very long "or" where clause
Date: 2007-01-16 10:07:07
Message-ID: 45ACA3CB.4070503@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Max Ueda 2007-01-16 12:14:26 Coercion in PGSQL?
Previous Message Scara Maccai 2007-01-16 09:50:09 Re: Very long "or" where clause