Re: [PERFORM] COUNT & Pagination

2004-01-19 Thread Neil Conway
"scott.marlowe" <[EMAIL PROTECTED]> writes: > Yes, previously run query should be faster, if it fits in kernel > cache. Or the PostgreSQL buffer cache. > Plus, the design of Postgresql is such that it would have to do a > LOT of cache checking to see if there were any updates to the > underlying

Re: [PERFORM] COUNT & Pagination

2004-01-16 Thread CoL
Hi, David Shadovitz wrote, On 1/11/2004 7:10 PM: I understand that COUNT queries are expensive. So I'm looking for advice on displaying paginated query results. I display my query results like this: Displaying 1 to 50 of 2905. 1-50 | 51-100 | 101-150 | etc. I do this by executing two quer

Re: [PERFORM] COUNT & Pagination

2004-01-14 Thread scott.marlowe
On Wed, 14 Jan 2004, Rajesh Kumar Mallah wrote: > scott.marlowe wrote: > > >On Tue, 13 Jan 2004, David Shadovitz wrote: > > > > > > > >>>We avert the subsequent execution of count(*) by passing the > >>>value of count(*) as a query parameter through the link in page > >>>numbers. > >>> >

Re: [PERFORM] COUNT & Pagination

2004-01-14 Thread Rajesh Kumar Mallah
scott.marlowe wrote: On Tue, 13 Jan 2004, David Shadovitz wrote: We avert the subsequent execution of count(*) by passing the value of count(*) as a query parameter through the link in page numbers. Mallah, and others who mentioned caching the record count:

Re: [PERFORM] COUNT & Pagination

2004-01-13 Thread scott.marlowe
On Tue, 13 Jan 2004, David Shadovitz wrote: > > We avert the subsequent execution of count(*) by passing the > > value of count(*) as a query parameter through the link in page > > numbers. > > Mallah, and others who mentioned caching the record count: > > Yes, I will certainly do this. I can d

Re: [PERFORM] COUNT & Pagination

2004-01-13 Thread David Shadovitz
> We avert the subsequent execution of count(*) by passing the > value of count(*) as a query parameter through the link in page > numbers. Mallah, and others who mentioned caching the record count: Yes, I will certainly do this. I can detect whether the query's filter has been changed, or whet

Re: [PERFORM] COUNT & Pagination

2004-01-13 Thread mallah
> I understand that COUNT queries are expensive. So I'm looking for advice > on > displaying paginated query results. > > I display my query results like this: > > 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: > > SE

Re: [PERFORM] COUNT & Pagination

2004-01-12 Thread Robert Treat
On Mon, 2004-01-12 at 10:37, David Shadovitz wrote: > > If you only need the count when you've got the results, most PG client > > interfaces will tell you how many rows you've got. What language is your app > > in? > > PHP. > But I have only a subset of the results, retrieved via a query with a "

Re: [PERFORM] COUNT & Pagination

2004-01-12 Thread David Shadovitz
> If you only need the count when you've got the results, most PG client > interfaces will tell you how many rows you've got. What language is your app > in? PHP. But I have only a subset of the results, retrieved via a query with a "LIMIT " clause, so $pg_numrows is m. And retrieving all results

Re: [PERFORM] COUNT & Pagination

2004-01-12 Thread Richard Huxton
On Sunday 11 January 2004 18:10, David Shadovitz wrote: > I understand that COUNT queries are expensive. So I'm looking for advice > on displaying paginated query results. > > I display my query results like this: > > Displaying 1 to 50 of 2905. > 1-50 | 51-100 | 101-150 | etc. > > I do this b

Re: [PERFORM] COUNT & Pagination

2004-01-11 Thread Christopher Kings-Lynne
I understand that COUNT queries are expensive. So I'm looking for advice on displaying paginated query results. I display my query results like this: 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 FROM WHERE L

Re: [PERFORM] COUNT & Pagination

2004-01-11 Thread Jeff Fitzmyers
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 FROM WHERE LIMIT m OFFSET n The other is identical except that I replace the select list with COUNT(*)

[PERFORM] COUNT & Pagination

2004-01-11 Thread David Shadovitz
I understand that COUNT queries are expensive. So I'm looking for advice on displaying paginated query results. I display my query results like this: 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 FROM WHERE