-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
planner: optimize the performance of SELECT count(*)
#37165
Comments
/assign @elsa0520 |
the execution speed of count()The main purpose of rewrite count() to count (the narrowest non-null column) at the planning layer to achieve the purpose of improving performance.
The logical rule of count star rewriterThe countStarRewriter is used to rewrite PatternLogcialAggregation: count(constant) OptimizeTable Case1 there are columns from datasource Case2 there is no columns from datasource |
Enhancement
Now we scan the primary key column in default. We can improve the performance of
SELECT count(*)
by scanning the del_tag column rather than the pk column.BTW, the following case will be improved, too.
The text was updated successfully, but these errors were encountered: