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

Allow exists2in and decorrelate-in to work for IN/EXISTS subqueries in arbitrary context

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • Optimizer
    • None

    Description

      Currently these transformations only apply if the subquery is either toplevel (e.g. select ... from ... where ... in (...);, or a toplevel not (e.g. select ... from ... where not exists (...);). It may be useful to enable them for subqueries in any context (e.g. select ... from ... where (... in (...)) is null).

      Before starting, it would be good to have an example query where such enhancement helps (e.g. allows materialization).

      An idea of implementing this is to use transformers instead of processors, the latter used in the current implementation as exists2in_processor().

      Examples of transformers:

        virtual Item *neg_transformer(THD *thd) { return NULL; }
        virtual Item *update_value_transformer(THD *thd, uchar *select_arg)
        { return this; }
        virtual Item *expr_cache_insert_transformer(THD *thd, uchar *unused)
        { return this; }
        virtual Item *derived_field_transformer_for_having(THD *thd, uchar *arg)
        { return this; }
      

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              ycp Yuchen Pei
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.