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

Support comments in new-style optimizer hints.

    XMLWordPrintable

Details

    Description

      New-style query optimizer hints allow one to use multi-line hints:

      explain 
      SELECT
        /*+ 
          QB_NAME(child_select, derived1 .derived2)
          JOIN_ORDER(@child_select t2, t1)
        */
        *
      FROM
        (select *
          from 
            (select t1.a, t2.b
             from t1, t2 where t1.a=t2.a limit 10
            ) as derived2
         ) AS derived1
      

      Hints are located in a /*! */ comment.
      It is not possible to comment-out a part of hint.

      One can have comments right below in a separate non-hint comment.

      But it seems trivial to allow hints parser to handle SQL-style -- comments like this:

        /*+ 
          QB_NAME(child_select, derived1 .derived2)    -- force this
          JOIN_ORDER(@child_select t2, t1)  -- force that
          INDEX(@child_select t2  index1)  -- do that...
        */
      

      Attachments

        Activity

          People

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