diff --git a/How-fast-are-really-the-analytical-DBMS%3F.md b/How-fast-are-really-the-analytical-DBMS%3F.md index dc8e2f2..cbe7f50 100644 --- a/How-fast-are-really-the-analytical-DBMS%3F.md +++ b/How-fast-are-really-the-analytical-DBMS%3F.md @@ -10,6 +10,32 @@ I did a small experiment with a synthetic dataset I created for the PyCon Spain ![Table](https://git.guillemborrell.es/guillem/blog/raw/branch/main/images/analyticdbms/Screenshot_20230212_215503_Chrome.jpg) +The query is designed to crash naive query engines, with a CTE and two nested aggregations: + +```sql +with by_nplayers as ( +SELECT + max(toss) as toss, + count(*) as qty, + count(*) as nplayers, + game +FROM + boards +GROUP BY + game +) +select + sum(qty) as qty, + toss, + nplayers +from + by_nplayers +group by + toss, nplayers +order by + nplayers, toss desc +``` + Here are the results for postgresql ![Postgresql timings](https://git.guillemborrell.es/guillem/blog/raw/branch/main/images/analyticdbms/Screenshot_20230212_213038_Chrome.jpg)