Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-19155

Execution plan for star join

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • Optimizer
    • None

    Description

      The execution plan for start join first must access the fact table. However before accessing this table a set of access primary keys must found as intersection pk-filters for conditions
      imposed on conditions.
      Example:
      Consider a star join schema with the fact table F and 2 dimension table D1 and D2.
      Let D1,D2 and F are defined as follows

      create table D1 (a int primary key, c int, index d1_c(c));
      create table D2 (b int primary key, c int, index d2_c(c));
      create table F (pk int primary key, a int, b int, index f_a(a), index f_b(b));
      

      Consider the query

      select count(*) from F, D1, D2
      where D1.a=F.a and D2.b=F.b and D1.a and D1.c in (C1,C2) and D2.c in (C3,C4);
      

      Using the index d1_c pk-filter for the condition D1.c in (C1,C2) is built D1_F. Then using the index f_a pk-filter D1_F for the table F is built from D1_F.
      Using the index d2_c pk-filter D1_F for the condition D2.c in (C3,C4) is built . Then using the index f_a pk-filter F_F2 for the table F is built from D2_F.
      F_F1 is intersected with F_F2. The intersection provides the set of pk keys of F that has to be accessed.

      Attachments

        Activity

          People

            igor Igor Babaev
            igor Igor Babaev
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.