-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MySQL table stats code cleanup #19391
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(SELECT CARDINALITY AS row_count FROM INFORMATION_SCHEMA.STATISTICS | ||
WHERE TABLE_SCHEMA = :schema AND TABLE_NAME = :table_name | ||
AND CARDINALITY IS NOT NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it's never possible for cardinality of any index to be > actual row count?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would guess this is still an estimate
f0e26e4
to
6d3c8c0
Compare
Previously the MySQL estimated table row count was calculated taking into account the CARDINALITY of single column indexes, and cardinality of first column in multi-column indexes. This commit expands this to include cardinality of every index.
6d3c8c0
to
0003894
Compare
No description provided.