Understanding the Differences Between Direct SQL and Question Query Builder in Metabase

database

Metabase is an OSS BI tool that allows you to retrieve and visualize data by writing queries, similar to Redash. In addition to self-hosting, there’s also a cloud version, and with the Pro plan or higher, you can render charts using the React SDK.

Redashでデータを可視化する - sambaiz-net

$ docker run -d -p 3000:3000 --name metabase metabase/metabase

It covers most major OSS and cloud databases, but unlike Redash, it doesn’t support DynamoDB or Google Sheets.

You can retrieve data by writing SQL directly or using the Question query builder.

There are slightly more chart types than Redash, but Python execution is not supported, and extending it seems difficult.

Like Redash, you can embed template variables in SQL using {{variable}}, and you can set default values or prompt for input.

Questions and directly written SQL are distinguished, and even with the same query, only those created with Questions can be drilled down from the dashboard, and filter conditions can be added without embedding template variables.

Questions contain no more information than SQL, so they are convenient to use in that they don’t depend on Metabase. However, Question queries that fetch all columns can be too inefficient for large tables, and complex queries may not be possible to write. For such cases, you can use Models, which allow you to write queries for intermediate tables like views and reference them as data for Questions.