pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: soni de <soni.de@gmail.com>
Cc: Merlin Moncure <mmoncure@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Takes too long to fetch the data from database
Date: Thu, 20 Apr 2006 01:30:14 -0500
Message-ID: <20060420063014.GA25438@wolff.to> (raw)
In-Reply-To: <9f2e40a90604192237i5d3e8f0dl1c8b19887bc34e22@mail.gmail.com>
References: <9f2e40a90604100021n1cb694d0lb95f318f800f33ee@mail.gmail.com>
	<b42b73150604100845w553dcee6kde20e4b82770aab0@mail.gmail.com>
	<9f2e40a90604110004u787716c2s22bdf53fe349326@mail.gmail.com>
	<b42b73150604110613h2c63ea61oec8035c8e2f4ed98@mail.gmail.com>
	<9f2e40a90604192237i5d3e8f0dl1c8b19887bc34e22@mail.gmail.com>

On Thu, Apr 20, 2006 at 11:07:31 +0530,
  soni de <soni.de@gmail.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;



view thread (17+ messages)  latest in thread

Message-ID: <20060420063014.GA25438@wolff.to>
Permalink:  ../20060420063014.GA25438@wolff.to/
Also on:    postgresql.org/message-id/20060420063014.GA25438@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: bruno@wolff.to, soni.de@gmail.com, mmoncure@gmail.com
  Subject: Re: Takes too long to fetch the data from database
  In-Reply-To: <20060420063014.GA25438@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox