On 5/13/2010 3:43 AM, Louis-David Mitterrand wrote: **snip*** > >> What do you mean by quite slow?? >> > Like several seconds. I have to cache the results. >
Well then i suggest posting the queries to Performance or here and let us take a look them don't forget to include the explain/analyze, and number of records in each table. >> On a 30K record table count() and query speed should not be a problem.. >> > This query is a large multi-join of times series data, not a single > table. And it's not (prematurely :) optimized. > > I'm planning a materialized view for it. > here read this http://www.pgcon.org/2008/schedule/events/69.en.html The question that begs to be asked how big are the tables the query is accessing?? if its not hundreds of thousands to millions of records or on a stone age Server , my guess is the query can be improved. > **snip** >> RecordCount/Limit = Number of pages >> CurrentPage = (offset%RecordCount)/Limit >> > These simple formulas we bill handy. > don't forget to use floor on these in what ever language your programming in All legitimate Magwerks Corporation quotations are sent in a .PDF file attachment with a unique ID number generated by our proprietary quotation system. Quotations received via any other form of communication will not be honored. CONFIDENTIALITY NOTICE: This e-mail, including attachments, may contain legally privileged, confidential or other information proprietary to Magwerks Corporation and is intended solely for the use of the individual to whom it addresses. If the reader of this e-mail is not the intended recipient or authorized agent, the reader is hereby notified that any unauthorized viewing, dissemination, distribution or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and destroy all occurrences of this e-mail immediately. Thank you. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql