Re: Analyze results in more expensive query plan

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Analyze results in more expensive query plan
Дата
Msg-id CAKJS1f91kNcgW0HTPJhtWEkW-hbncJpqdpAU6gmcZ=Bx15yR6Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Analyze results in more expensive query plan  (Jeremy Altavilla <jeremyaltavilla@gmail.com>)
Ответы Re: Analyze results in more expensive query plan  (Jeremy Altavilla <jeremyaltavilla@gmail.com>)
Список pgsql-performance
On Tue, 21 May 2019 at 08:23, Jeremy Altavilla
<jeremyaltavilla@gmail.com> wrote:
>
> Thanks for the suggestion. I created extended statistics objects for the two tables in question. Unfortunately the
resultingplan was the same (and had the same estimates). It looks like the extended stats discovered a potentially
usefulcorrelation on bag: "2, 3 => 1" (owner_id, bag_type_id => id). I'm guessing this wasn't usable because the docs
state"They are not used to improve estimates for equality conditions comparing two columns". 

I'd say that since the time spent planning is near 3x what is spent
during execution that you're wasting your time trying to speed up the
execution.  What you should be thinking about is using PREPAREd
statements to avoid the planning overhead completely.  If that's not
possible then you've more chance of reducing the time spent planning
by reducing the statistics on the table rather than adding more
planning overhead by adding extended stats.  You might want to
experiment with ALTER TABLE ... ALTER COLUMN ... SET STATISTICS ..;
and setting those down a bit then analyzing the tables again.
Although, that's likely only going to make a very small difference, if
any, than getting rid of the planning completely.

--
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Temporarily very slow planning time after a big delete
Следующее
От: Walter Smith
Дата:
Сообщение: Re: Temporarily very slow planning time after a big delete