Re: Massive slowdown when LIMIT applied

From: "macgillivary" <macgillivary(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Massive slowdown when LIMIT applied
Date: 2006-08-19 01:47:30
Message-ID: 1155952050.386252.318770@74g2000cwt.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Purely out of curiosity, what sort of execution time do you get if you
use:

SELECT *
FROM (SELECT username,acctstarttime FROM radacct WHERE username='user'

ORDER BY acctstarttime ) allstarttimes
LIMIT 50;

Graeme Hinchliffe wrote:
>
> Now, if I do the following:
>
> SELECT username,acctstarttime FROM radacct WHERE username='user'
> ORDER BY acctstarttime LIMIT 50;
>
> I have to wait a very long time, IE instead of 2-3 seconds.. can be
> as slow as 10+ minutes.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2006-08-19 02:16:35 Re: Inserting Data
Previous Message Tom Lane 2006-08-19 00:15:47 Re: Query optimization and indexes