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

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

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.28
    • Fix Version/s: 5.5.29
    • Component/s: None
    • Labels:
      None
    • Environment:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: