risinglight icon indicating copy to clipboard operation
risinglight copied to clipboard

expression: do not bind column for `count(*)` in binder

Open skyzh opened this issue 3 years ago • 1 comments

https://github.com/risinglightdb/risinglight/blob/40db687e7424da4ef96661c9cfe65adcbcf5a1a6/src/binder/expression/agg_call.rs#L65-L83

Currently, we always select the 0th column in binder for count(*). This has caused problems like https://github.com/risinglightdb/risinglight/issues/200. In the future, we should be able to do both of the following:

  • bind all columns in binder, and do column prune in optimizer
  • rewrite count(*) to using statistics information (only for queries like select count(*) from table)

skyzh avatar Jan 31 '22 07:01 skyzh

I will solve this problem after @st1page finishes his work.

likg227 avatar Feb 03 '22 15:02 likg227