On Feb 08 2024 at 07:14:18, Andrei Lepikhov wrote:
1. In the case of parallel workers the plan_rows value has a different
semantics than the number of rows predicted. Just explore
get_parallel_divisor().
Yes, this is a very weighty and important issue. I need to think about
this very carefully.
2. The extension recommends new statistics immediately upon an error
finding. But what if the reason for the error is stale statistics? Or
this error may be raised for only one specific set of constants, and
estimation will be done well in another 99.9999% of cases for the same
expression.
According to No.2, it might make sense to collect and track clause
combinations and cardinality errors found and let the DBA make decisions
on their own.
Your proposal is very interesting. In my opinion, it is worth
considering updating the extended statistics if they are truly stale.
And write about this in a separate message with suggestion updating
statistics.
If I succeed, then in the next patch I will add the kind of extended
statistics to the message, deal with the parallel workers and update
statistics if necessary.
If you have additional suggestions and thoughts, feel free to write them
in this thread.
Regards,
Ilia Evdokimov,
Tantor Labs LLC.