Re: BUG #15233: Error in estimation leads to very bad parralel planin simple 2 table join. - Mailing list pgsql-bugs

From Maxim Boguk
Subject Re: BUG #15233: Error in estimation leads to very bad parralel planin simple 2 table join.
Date
Msg-id CAK-MWwRh=J70OTJYtct-j=RV2BmPtq4bhMzgPtwN4Vc0ygBcxQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #15233: Error in estimation leads to very bad parralel planin simple 2 table join.  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-bugs

>  Planning time: 2.953 ms
>  Execution time: 2084537.882 ms
>
> Problem with estimation of selectivity
>    ->  Seq Scan on area a  (cost=0.00..265.70 rows=1 width=106) (actual
> time=0.669..1.756 rows=23 loops=1)
>         
​​
Filter: ((path)::text ~~ '%.1806.%'::text)
> leads to very dangerous idea to perform nested loop with very heavy parallel
> plan inside.
>

Is it because you have not performed Analyze on the 'area' or is it
something else due to which there is such a deviation in estimation?



​Hi,​

I don't think there is good way estimate selectivity of
Filter: ((path)::text ~~ '%.1806.%'::text)

But problem that there huge difference in real plan cost with exactly 1 row vs 2 or more rows estimated. Problem still exists without parallel plan involved, where is leads to 23 seq scan over table with 100M rows :(.


--
Maxim Boguk
Senior Postgresql DBA
http://dataegret.com/

Phone RU: +7  985 433 0000
Phone UA: +380 99 143 0000
Phone AU: +61  45 218 5678

LinkedIn: http://www.linkedin.com/pub/maksym-boguk/80/b99/b1b
Skype: maxim.boguk

"Доктор, вы мне советовали так не делать, но почему мне по-прежнему больно когда я так делаю ещё раз?"

pgsql-bugs by date:

Previous
From: Amit Kapila
Date:
Subject: Re: BUG #15233: Error in estimation leads to very bad parralel planin simple 2 table join.
Next
From: Thomas Munro
Date:
Subject: Re: BUG #15225: [XX000] ERROR: invalid DSA memory alloc request size1073741824 / Where: parallel worker