Very long "or" where clause

Поиск
Список
Период
Сортировка
От Scara Maccai
Тема Very long "or" where clause
Дата
Msg-id 45AC9613.6030204@yahoo.it
обсуждение исходный текст
Ответы Re: Very long "or" where clause  (Florian Weimer <fweimer@bfk.de>)
Re: Very long "or" where clause  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Hi,
from a table with 100,000,000 rows I have to sum some records using a
query like:

select sum(field1) from mytab where
  (time = 1 and id = 3)
or
  (time = 3 and id = 1)
or
  (time = 2 and id = 5)
[...]


The "or clauses" can be even 10,000,000...
Which would be the best method to access data? Should I use a procedure
on the server side?





В списке pgsql-general по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: [HACKERS] Checkpoint request failed on version 8.2.1.
Следующее
От: Florian Weimer
Дата:
Сообщение: Re: Very long "or" where clause