metabase / metabase/metabase

Configurable join type for implicit joins

Open
#70,300 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

.Auto triaged .Team/QueryingPlatform Type:New Feature
Dominant language
Clojure
Stars
49.3k
Forks
6.8k
Avg merge
1d 13h
Merged PRs (30d)
653

Description

**What problem will this feature request solve?**
Currently, Metabase always generates a LEFT JOIN when fields from an implicitly joined dimension table are used in the Query Builder.

There is no way to configure the join type, which may create performance limitations. Actual example from customer:
> In Amazon Redshift, LEFT JOIN can prevent Automatic Query Rewriting (AQR) from matching queries against materialized views.
> An INNER JOIN would allows AQR to occur. This means that the current behavior blocks materialized view matching and has measurable performance impact on large fact tables.

**Describe the solution you'd like.**
Allow configuring the implicit join type to be set per foreign key relationship in the Admin → Data Model section.

**How does this feature request impact you?**
Customer request

**Additional information**
Having join strategy configurable per foreign key would enable performance optimization for warehouse related use cases.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Admin → Data Model and trace how implicit joins are generated when Query Builder fields come from a dimension table. Determine how a join type could be stored per foreign key relationship and applied to those joins. Done means users can configure the type per relationship and generated queries use that setting.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.