Re: Takes too long to fetch the data from database

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: soni de <soni(dot)de(at)gmail(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Takes too long to fetch the data from database
Date: 2006-04-20 06:30:14
Message-ID: 20060420063014.GA25438@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Apr 20, 2006 at 11:07:31 +0530,
soni de <soni(dot)de(at)gmail(dot)com> wrote:
> Please provide me some help regarding how could I use cursor in following
> cases? :
>
> I want to fetch 50 records at a time starting from largest stime.
>
> SELECT * FROM wan ORDER BY stime LIMIT 50 OFFSET 81900;

Something like the following may be faster:
SELECT * FROM wan ORDER BY stime DESC LIMIT 50;

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Doron Baranes 2006-04-20 08:23:57 Perfrmance Problems (7.4.6)
Previous Message soni de 2006-04-20 05:37:31 Re: Takes too long to fetch the data from database