Skip to content
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

binder: plan not optimal for count(*) with filter #482

Closed
skyzh opened this issue Feb 16, 2022 · 2 comments · Fixed by #559
Closed

binder: plan not optimal for count(*) with filter #482

skyzh opened this issue Feb 16, 2022 · 2 comments · Fixed by #559
Labels
enhancement New feature or request

Comments

@skyzh
Copy link
Member

skyzh commented Feb 16, 2022

PhysicalProjection: exprs [InputRef #0]
  PhysicalSimpleAgg: 1 agg calls
    PhysicalTableScan: table #9, columns [0], with_row_handler: true, is_sorted: false, expr: Gt(InputRef #0, Int32(5) (const))

The plan is not optimal. As we already have column 0 scanned, we don't need row handler.

We can refine the binder logic later to handle this case, and get this PR merged at first. Thanks!

Originally posted by @skyzh in #447 (comment)

@skyzh skyzh added the enhancement New feature or request label Feb 16, 2022
@skyzh
Copy link
Member Author

skyzh commented Feb 16, 2022

Looks better like a task for optimizer... Only optimizer knows how many columns will be read indeed.

@xxchan
Copy link
Member

xxchan commented Feb 19, 2022

discussions here #503

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants