Re: COUNT & Pagination - Mailing list pgsql-performance

From Jeff Fitzmyers
Subject Re: COUNT & Pagination
Date
Msg-id 107436B6-4479-11D8-BE00-000A959C6000@cloverpub.com
Whole thread Raw
In response to COUNT & Pagination  (David Shadovitz <david@shadovitz.com>)
List pgsql-performance
> So I'm looking for advice on displaying paginated query results.
> Displaying 1 to 50 of 2905.
>   1-50 | 51-100 | 101-150 | etc.
>
> I do this by executing two queries.  One is of the form:
>   SELECT <select list> FROM <view/table list> WHERE <filter> LIMIT m
> OFFSET n
> The other is identical except that I replace the select list with
> COUNT(*).

This is the only way I know of how to do it.

> I'm running PG 7.2.2 and want to upgrade to 7.4.1.  I've never
> upgraded PG
> before and I'm nervous.  Can I simply run pg_dumpall, install 7.4.1,
> and then
> feed the dump into psql?

I would practice and play with it on another machine until you can do
it easily. You will learn a lot and the experience might prove
invaluable in may ways :-)

Jeff



pgsql-performance by date:

Previous
From: Dennis Bjorklund
Date:
Subject: Re: Explain not accurate
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: Explain not accurate