planner: distinguish `analyzed empty table` and `un-analyzed table` in statistics
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
Now the planner cannot distinguish `analyzed empty table` and `un-analyzed table` in statistics, and uses `pesudo-stats` for these tables, which may lead to sub-optimal plans.
For example, when joining an empty table with a large table, if the planner uses `pesudo-stats` for the empty table, then it thinks this empty table `has` 10000 rows and may select a `MergeJoin` or `HashJoin` for this query, which needs to scan the large table.
But if the planner knows the empty table has 0 rows correctly, it can use it as a driver table and select `IndexJoin` for this query.

Contributor guide
Assessment
This issue has not been assessed yet.