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

Aggregate functions min max over a partition have quadratic complexity

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4.17, 10.5.8, 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
    • 10.5, 10.6
    • None

    Description

      create or replace table t(id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,part bigint(20) NOT NULL,ts bigint(20) DEFAULT NULL, key idx(part) );

      set @seq:=1; insert into t select null ,1 , @seq;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      insert into t select null ,1 , @seq:=@seq+1 from t;
      select part , MAX(ts) OVER (PARTITION BY part) AS ts_max FROM t where part=1;

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              stephane@skysql.com VAROQUI Stephane
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.