Open ramsrivatsa opened 2 years ago
The following items needs to be addressed:
/* YugaByte does not support forwarding statistics to Postgres yet */
if (IsYugaByteEnabled())
return NIL;
RestrictInfo
from each clause. clauselist_selectivity
baserel->rows
, etc. to path->rows
, just like other cost_xxxscan functions.
/* Mark the path with the correct row estimate */
if (param_info)
path->rows = param_info->ppi_rows;
else
path->rows = baserel->rows;
ALTER STATISTICS
T_AlterStatsStmt
to the DDL liststats_ext.sql
try to verify use of the extended stats via plan changes, which do not work well because of the cost formula differences and unavailability of some plans. Start over porting the tests from PG15 that verify the row count estimate changes.
Jira Link: DB-3173
Description
The existing Yugabyte cost model does not leverage user-defined extended statistics. Consider the following example.
We can see that even after creating statistics, the estimated number of rows is 30000, however, the actual rows are 301. The extended statistics that are listed from
pg_statistic_ext
clearly show that the number of distinct rows is 301.From this, we are able to see that the YB query planner does not leverage extended statistics towards row estimation and subsequently, the cost model is unaffected.