Re: Takes too long to fetch the data from database - Mailing list pgsql-performance

From Bruno Wolff III
Subject Re: Takes too long to fetch the data from database
Date
Msg-id 20060421174149.GA13275@wolff.to
Whole thread Raw
In response to Re: Takes too long to fetch the data from database  ("soni de" <soni.de@gmail.com>)
List pgsql-performance
On Fri, Apr 21, 2006 at 10:12:24 +0530,
  soni de <soni.de@gmail.com> wrote:
> I don't want to query exactly 81900 rows into set. I just want to fetch 50
> or 100 rows at a time in a decreasing order of stime.(i.e 50 or 100 rows
> starting from last to end).

You can do this efficiently, if stime has an index and you can deal with using
stime from the previous query instead of the record count. The idea is to
select up 50 or 100 records in descending order where the stime is <=
the previous stime. This can give you some overlapping records, so you need
some way to deal with this.

pgsql-performance by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Inactive memory Grows unlimited
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Takes too long to fetch the data from database