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

Spider COUNT(*) issues against ColumnStore as one of the Backend

    XMLWordPrintable

Details

    Description

      When executing a simple `SELECT COUNT FROM acct_detail` the queries or any other with agre sent to the backend nodes contains the partition key as one of the columns leading to the error

      MariaDB [testdb]> select count(*) from acct_detail;
      ERROR 1815 (HY000): Internal error: IDB-2021: '`testdb`.`acct_detail_hist`.`id`' is not in GROUP BY clause. All non-aggregate columns in the SELECT and ORDER BY clause must be included in the GROUP BY clause.
      

      Analyzing the general query log, the output shows the following two queries being executed on the ColumnStore and InnoDB tables

      44 Query    select count(0),`id` from `testdb`.`acct_detail_curr`
      44 Query    select count(0),`id` from `testdb`.`acct_detail_hist`
      

      Spider node definition as follows:

      MariaDB [testdb]> show create table acct_detail\G
      *************************** 1. row ***************************
             Table: acct_detail
      Create Table: CREATE TABLE `acct_detail` (
        `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
        `c1` varchar(100) DEFAULT NULL,
        `dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
        UNIQUE KEY `id` (`id`)
      ) ENGINE=SPIDER AUTO_INCREMENT=274116 DEFAULT CHARSET=latin1 COMMENT='wrapper "mysql", srv "node"'
       PARTITION BY KEY (`id`)
      (PARTITION `pt_current` COMMENT = 'table "acct_detail_curr"' ENGINE = SPIDER,
       PARTITION `pt_historic` COMMENT = 'table "acct_detail_hist"' ENGINE = SPIDER)
      

      Thanks.

      Attachments

        Issue Links

          Activity

            People

              Kentoku Kentoku Shiba (Inactive)
              Faisal Faisal Saeed (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 2d
                  2d

                  Git Integration

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