Re: slow SELECT ... LIMIT query - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: slow SELECT ... LIMIT query
Date
Msg-id 20010719115556.B1044@svana.org
Whole thread Raw
In response to slow SELECT ... LIMIT query  ("Simon Stanlake" <stanlake@hi.ca>)
List pgsql-general
On Wed, Jul 18, 2001 at 10:49:29AM -0700, Simon Stanlake wrote:
> Hi,
>
> I have a fairly large table (1 million records) with the following
> structure...
>
[snip]

Well, it's fai;rly hard to guess at questions like this unless you provide
some more details. Do you think you could post EXPLAIN outputs for both
queries?

> Is this common when you use the LIMIT clause?  Is there a work around?

It shouldn't happen but something that might work is to create a cursor and
then do fetch 1;

--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> It would be nice if someone came up with a certification system that
> actually separated those who can barely regurgitate what they crammed over
> the last few weeks from those who command secret ninja networking powers.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: RE: Intermittent Startup Failures
Next
From: "Dr. Evil"
Date:
Subject: Re: pl-sql