EmmyMiao87 opened a new issue #5409: URL: https://github.com/apache/incubator-doris/issues/5409
# Background When there is count(*) function in query, we only need to scan the smallest column. But currently Doris does not column pruning in some cases. Table structure: ``` MySQL [test]> desc base; +-------+--------+------+-------+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------+------+-------+---------+-------+ | k1 | INT | Yes | true | NULL | | | k2 | BIGINT | Yes | true | NULL | | | k3 | DOUBLE | Yes | false | NULL | NONE | +-------+--------+------+-------+---------+-------+ 3 rows in set (0.011 sec) ``` Situation1: ```select count(*) from base``` Only k1 is materialized. Situation2: ```select count(*) from (select * from base) tmp``` **Column pruning becomes invalid** All columns( k1, k2,k3 ) which belongs to base table are materialized. # Expectation The column pruning could be effect in situation2. Only k1 should be materialized in situation2. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
