Re: Bad plan

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: Bad plan
Дата
Msg-id 20180123151848.GC25452@telsasoft.com
обсуждение исходный текст
Ответ на Bad plan  (Laurent Martelli <martellilaurent@gmail.com>)
Ответы Re: Bad plan
Список pgsql-performance
On Tue, Jan 23, 2018 at 01:03:49PM +0100, Laurent Martelli wrote:
> Hello all,
> 
> So I have a view, for which I can select all rows in about 3s (returns ~80k
> rows), but if I add a where clause on a column, it takes +300s to return
> the ~8k lines.
> 
> From the plan, I see that it expects to return only 1 row and so choose to
> perform some nested loops. Of course, I did run "ANALYZE", but with no
> success.
> 
> I managed to speed things up with "set enable_nestloop = false;", but is
> that the only choice I have ? Should I report a bug ?


> Here is the default plan :

Can you resend without line breaks or paste a link to explain.depesz?

The problem appears to be here:

->  Nested Loop Left Join  (cost=32067.09..39197.85 rows=1 width=276) (actual time=342.725..340775.031 rows=7359
loops=1)
Join Filter: (sh.share_holder_partner = partner.id)
Rows Removed by Join Filter: 204915707

Justin


В списке pgsql-performance по дате отправления:

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: 8.2 Autovacuum BUG ?
Следующее
От: Pavan Teja
Дата:
Сообщение: Re: 8.2 Autovacuum BUG ?