alamb opened a new issue, #5547:
URL: https://github.com/apache/arrow-datafusion/issues/5547

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   
   Queries like this (which compute distinct values for  high cardinality 
columns) are currently relatively slow (if there are many values of `UserID`):
   ```
   SELECT 
     SUM(EngineId), 
     COUNT(*) AS c, 
     COUNT(DISTINCT "UserID")
   FROM 
     hits 
   GROUP BY 
     "RegionID" 
   ORDER BY 
     c DESC 
   LIMIT 10;
   ```
   
   Here is a specific clickbench query from the discussion on 
https://github.com/apache/arrow-datafusion/issues/5276 
   ```sql
   ❯ SELECT "RegionID", SUM("AdvEngineID"), COUNT(*) AS c, 
AVG("ResolutionWidth"), COUNT(DISTINCT "UserID") FROM hits GROUP BY "RegionID" 
ORDER BY c DESC LIMIT 10;
   ```
   
   **Describe the solution you'd like**
   We could make this type of query faster. Hopefully we can collect ideas here
   
   **Describe alternatives you've considered**
   TBD
   
   **Additional context**
   This is one area where clickhouse and duckdb are particularly strong
   
   See https://github.com/apache/arrow-datafusion/issues/5276 and  
https://github.com/apache/arrow-datafusion/issues/5276#issuecomment-1433650162


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to