Skip site navigation (1) Skip section navigation (2)

Re: COUNT & Pagination

From: Jeff Fitzmyers <jeff(at)cloverpub(dot)com>
To: "david(at)shadovitz(dot)com" <david(at)shadovitz(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: COUNT & Pagination
Date: 2004-01-11 20:59:36
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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 
> 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 :-)


In response to

pgsql-performance by date

Next:From: Christopher Kings-LynneDate: 2004-01-12 00:24:00
Subject: Re: Explain not accurate
Previous:From: CoLDate: 2004-01-11 20:01:18
Subject: Re: COUNT & Pagination

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group