Re: limit clause breaks query planner? - Mailing list pgsql-performance

From Russell Smith
Subject Re: limit clause breaks query planner?
Date
Msg-id 48BCB90D.8090606@pws.com.au
Whole thread Raw
In response to Re: limit clause breaks query planner?  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Responses Re: limit clause breaks query planner?  (Guillaume Cottenceau <gc@mnc.ch>)
List pgsql-performance
Pavel Stehule wrote:
> Hello
>
> 2008/9/1 David West <david.west@cusppoint.com>:
>
>> Thanks for your suggestion but the result is the same.
>>
>> Here is the explain analyse output from different queries.
>> Select * from my_table where A is null and B = '21' limit 15
>>
>> "Limit  (cost=0.00..3.68 rows=15 width=128) (actual time=85837.043..85896.140 rows=15 loops=1)"
>> "  ->  Seq Scan on my_table this_  (cost=0.00..258789.88 rows=1055580 width=128) (actual time=85837.038..85896.091
rows=15loops=1)" 
>> "        Filter: ((A IS NULL) AND ((B)::text = '21'::text))"
>> "Total runtime: 85896.214 ms"
>>
>>
[snip]

Further to Pavel's comments;

(actual time=85837.038..85896.091 rows=15 loops=1)

That's 85 seconds on a sequence scan to return the first tuple.  The table is not bloated by any chance is it?

Regards

Russell




pgsql-performance by date:

Previous
From: Duan Ligong
Date:
Subject: Re: too many clog files
Next
From: Greg Smith
Date:
Subject: Re: too many clog files