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

Query against view over IS tables worse than equivalent query without view

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5.28
    • 5.5.29
    • None
    • None
    • Linux x64

    Description

      A view which access an information schema table seems to use another plan, than the query in its extend explain output (it scan's all databases)

      CREATE VIEW v1 AS SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS;

      explain extended select column_name FROM v1 WHERE TABLE_SCHEMA="osm" AND TABLE_NAME="test";

      extra: Using where; Open_frm_only; Scanned all databases

      show warnings;
      ..
      select `information_schema`.`COLUMNS`.`COLUMN_NAME` AS `COLUMN_NAME` from `INFORMATION_SCHEMA`.`COLUMNS` where ((`information_schema`.`COLUMNS`.`TABLE_SCHEMA` = 'osm') and (`information_schema`.`COLUMNS`.`TABLE_NAME` = 'test'))

      explain select `information_schema`.`COLUMNS`.`COLUMN_NAME` AS `COLUMN_NAME` from `INFORMATION_SCHEMA`.`COLUMNS` where ((`information_schema`.`COLUMNS`.`TABLE_SCHEMA` = 'osm') and (`information_schema`.`COLUMNS`.`TABLE_NAME` = 'test'));

      extra: Using where; Open_frm_only; Scanned 0 databases

      Attachments

        Activity

          People

            timour Timour Katchaounov (Inactive)
            georg Georg Richter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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