[prev in list] [next in list] [prev in thread] [next in thread]
List: pgsql-performance
Subject: Re: Plan not skipping unnecessary inner join
From: Ranier Vilela <ranier.vf () gmail ! com>
Date: 2020-05-17 14:05:39
Message-ID: CAEudQApPBa1BDcktwY3oc6hvRNs9hrHJNALfcJUc7gHvbhZ7fw () mail ! gmail ! com
[Download RAW message or body]
Em dom., 17 de mai. de 2020 =C3=A0s 10:31, Justin Pryzby <pryzby@telsasoft.=
com>
escreveu:
> On Sun, May 17, 2020 at 09:32:47AM -0300, Ranier Vilela wrote:
> > I redid the same tests with vanila postgres and with empty tables.
> > I'm surprised, why does the plan have 2550 rows in explain?
>
> That's the *estimated* rowcount.
>
> The planner tends to ignore table statistics which say the table is empty=
,
> since that can lead to a terrible plan if it's not true (stats are out of
> date
> or autovacuum threshold not hit).
>
Thanks for the explanation.
regards,
Ranier Vilela
[Attachment #3 (text/html)]
<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em dom., 17 \
de mai. de 2020 Ã s 10:31, Justin Pryzby <<a \
href="mailto:pryzby@telsasoft.com">pryzby@telsasoft.com</a>> \
escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sun, May 17, 2020 \
at 09:32:47AM -0300, Ranier Vilela wrote:<br> > I redid the same tests with vanila \
postgres and with empty tables.<br> > I'm surprised, why does the plan have \
2550 rows in explain?<br> <br>
That's the *estimated* rowcount.<br>
<br>
The planner tends to ignore table statistics which say the table is empty,<br>
since that can lead to a terrible plan if it's not true (stats are out of \
date<br> or autovacuum threshold not hit).<br></blockquote><div>Thanks for the \
explanation.</div><div><br></div></div><div class="gmail_quote">regards,</div><div \
class="gmail_quote">Ranier Vilela<br></div></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic