Re: Give me a HINT or I'll got crazy ;)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Give me a HINT or I'll got crazy ;)
Дата
Msg-id 26897.1255023532@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Give me a HINT or I'll got crazy ;)  (wstrzalka <wstrzalka@gmail.com>)
Ответы Re: Give me a HINT or I'll got crazy ;)  (Wojciech Strzałka <wstrzalka@gmail.com>)
Список pgsql-general
wstrzalka <wstrzalka@gmail.com> writes:
> Prior to the playing with statistics target (it was 100 by default) I
> was able to go with the time to 30ms by adding to the query such a
> condition:

So what sort of "playing" did you do?  It looks to me like the core of
the problem is the sucky join size estimate here:

>    ->  Hash Join  (cost=101.53..15650.39 rows=95249 width=8) (actual
> time=1102.977..1342.675 rows=152 loops=1)
>          Hash Cond: (mal.message_id = m.messageid)

If it were correctly estimating that only a few message_address_link
rows would join to each messages row, it'd probably do the right thing.
But it seems to think there will be thousands of joins for each one...

            regards, tom lane

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

Предыдущее
От: Emanuel Calvo Franco
Дата:
Сообщение: Re: How to reduce WAL file Size
Следующее
От: Scott Bailey
Дата:
Сообщение: Re: Tips/Hacks to create minial DB from the execution of several (simple) SQL requests.