Search Postgresql Archives

Very long "or" where clause

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux