andygrove commented on issue #744:
URL: 
https://github.com/apache/datafusion-comet/issues/744#issuecomment-2260940328

   With the latest DataFusion, I see that count is actually faster than sum.
   
   ```sql
   > select l_shipmode, sum(l_linenumber) from 'lineitem.parquet' group by 1;
   +------------+------------------------------------+
   | l_shipmode | sum(lineitem.parquet.l_linenumber) |
   +------------+------------------------------------+
   | AIR        | 257182624                          |
   | REG AIR    | 257116345                          |
   | MAIL       | 257171951                          |
   | FOB        | 257164573                          |
   | RAIL       | 257195346                          |
   | SHIP       | 257156584                          |
   | TRUCK      | 257165514                          |
   +------------+------------------------------------+
   7 row(s) fetched. 
   Elapsed 1.136 seconds.
   
   > select l_shipmode, sum(1) from 'lineitem.parquet' group by 1;
   +------------+---------------+
   | l_shipmode | sum(Int64(1)) |
   +------------+---------------+
   | RAIL       | 85734456      |
   | AIR        | 85729153      |
   | SHIP       | 85718196      |
   | TRUCK      | 85719689      |
   | REG AIR    | 85710420      |
   | MAIL       | 85714788      |
   | FOB        | 85711200      |
   +------------+---------------+
   7 row(s) fetched. 
   Elapsed 1.039 seconds.
   
   > select l_shipmode, count(l_linenumber) from 'lineitem.parquet' group by 1;
   +------------+--------------------------------------+
   | l_shipmode | count(lineitem.parquet.l_linenumber) |
   +------------+--------------------------------------+
   | REG AIR    | 85710420                             |
   | FOB        | 85711200                             |
   | TRUCK      | 85719689                             |
   | SHIP       | 85718196                             |
   | AIR        | 85729153                             |
   | RAIL       | 85734456                             |
   | MAIL       | 85714788                             |
   +------------+--------------------------------------+
   7 row(s) fetched. 
   Elapsed 1.027 seconds.
   
   > select l_shipmode, count(*) from 'lineitem.parquet' group by 1;
   +------------+----------+
   | l_shipmode | count(*) |
   +------------+----------+
   | REG AIR    | 85710420 |
   | FOB        | 85711200 |
   | TRUCK      | 85719689 |
   | MAIL       | 85714788 |
   | SHIP       | 85718196 |
   | RAIL       | 85734456 |
   | AIR        | 85729153 |
   +------------+----------+
   7 row(s) fetched. 
   Elapsed 1.122 seconds.
   ```


-- 
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.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to