databend
databend copied to clipboard
Feature: Introduce `ConstTableScan` operator to accelerate table scan with no required columns
Sometimes, we have to read data from a table while none of the columns will be used in the query.
For example:
-
select count(*) from t
-
select * from t where exists(select * from t1)
, none of column fromt1
will be used
To accelerate such queries, we can leverage with a new operator ConstTableScan
, which will retrieve a dummy column for each row of data.
cc @sundy-li
system.zeros
m1max.local :) select * from zeros limit 5;
โโzeroโโ
โ 0 โ
โ 0 โ
โ 0 โ
โ 0 โ
โ 0 โ
โโโโโโโโ
5 rows in set. Elapsed: 0.001 sec.