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

EXCEPT with identical left/right queries isn't eliminated

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 11.7.2
    • 11.8
    • Optimizer
    • None
    • docker

    Description

      q1: SELECT * FROM TABLES CROSS JOIN VIEWS ON TRUE
      q2: SELECT * FROM TABLES CROSS JOIN VIEWS ON NOT FALSE;
      Since q1 is Semantically equivalent to q2, q1 EXCEPT q2 should always return an empty set and consume minimal execution time. However, the query returns a non-empty result (8670 rows in set ) and wastes some computation time (6.337 sec) compared to DBMSs without this bug.
      MariaDB > use information_schema;
      MariaDB [information_schema]> SELECT * FROM TABLES CROSS JOIN VIEWS ON TRUE EXCEPT SELECT * FROM TABLES CROSS JOIN VIEWS ON NOT FALSE;
      ...
      8670 rows in set (6.337 sec)

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              jinhui lai jinhui lai
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.