Pivot pre-grouped DB data

Dashboards to be used should be designed for performance.

To get good dashboard performance in Metabase 44.3 for statistical data we:

  1. pre-group/prepare data as much as we can to minimize SELECT time;
  2. completely avoid pivot table functionality because it's really not mature (instead we:
  • use some trick in SQL to make table visual data look like pivot table,
  • even adding +/- functionality in separate columns clickable and update filters through links
  • plus we pre-group data in PostgreSQL using GROUPING SETS, ROLLUP, CUBE and establish good index base with INCLUDE clause in PostgreSQL indexes.

All this helps get very fast "pivot like" tables in cards, but the development cost is high.

For Metabase it will be nice feature to support:

  1. pivot tables over pre-grouped database data (this will be really fast), meaning that Metabases will not group it itself, just fetch from database.
  2. fetch for client pivot visual only those grouping sets that are required for current visualization.

This will sure work very fast.

Regards, Alexey

Hi @ameledin
There's a request for that:
https://github.com/metabase/metabase/issues/19862 - upvote by clicking :+1: on the first post