Re: [PERFORM] Speed differences between in executing the same query

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PERFORM] Speed differences between in executing the same query
Дата
Msg-id 8393.1494511618@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [PERFORM] Speed differences between in executing the same query  (plukovic <petar@sobot.biz>)
Ответы Re: [PERFORM] Speed differences between in executing the same query  (plukovic <petar@sobot.biz>)
Список pgsql-performance
plukovic <petar@sobot.biz> writes:
> I have a weird case of query execution performance here.

My first thought is that you are getting a bad plan because of this
estimation error:

>                     ->  Index Scan using uk_TBL_sk0_account_code on TBL_sk
> sk2_  (cost=0.14..12.53 rows=1 width=426) (actual time=1.036..1.084 rows=50
> loops=1)
>                           Index Cond: (acco_id = 1)

That rowcount estimate is off by 50X, resulting in 50X errors for the
joins above it too, and in misguided choices of nestloops when some
other join method would be better.  Probably things would improve with
a better estimate.  Maybe you need to increase the stats target for
that table ... or maybe it just hasn't been ANALYZEd lately?

            regards, tom lane


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

Предыдущее
От: plukovic
Дата:
Сообщение: [PERFORM] Speed differences between in executing the same query
Следующее
От: plukovic
Дата:
Сообщение: Re: [PERFORM] Speed differences between in executing the same query