Re: Bad plan for nested loop + limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 14, 2009 at 5:25 PM, Alexander Staubo <alex@xxxxxxxxxx> wrote:
>
> Output from "explain analyze":
>
>  Limit  (cost=0.00..973.63 rows=4 width=48) (actual
> time=61.554..4039.704 rows=1 loops=1)
>   ->  Nested Loop  (cost=0.00..70101.65 rows=288 width=48) (actual
> time=61.552..4039.700 rows=1 loops=1)
>         ->  Nested Loop  (cost=0.00..68247.77 rows=297 width=52)
> (actual time=61.535..4039.682 rows=1 loops=1)

Those estimates are pretty far off. Did you try increasing the
statistics target? Also, is the first query repeatable (that is, is it
already in cache when you do the test, or alternately, are all queries
*out* of cache when you test?)
-- 
- David T. Wilson
david.t.wilson@xxxxxxxxx

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux