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

Undesired max_recursive_iterations warning

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.1.2
    • None
    • Optimizer - CTE
    • None
    • Win64

    Description

      Sample query

      WITH a AS (SELECT 5 mx)
      SELECT column_value FROM a,
      (
      WITH recursive r as
      (SELECT 1 level
      union all
      select LEVEL+1 FROM r
      )
      select LEVEL column_value FROM r
      ) i
      WHERE i.column_value<=a.mx
      

      runs OK, but on insert or temporary table create:

      CREATE OR REPLACE TEMPORARY TABLE tmp0 as
      WITH a AS (SELECT 5 mx)
      SELECT column_value FROM a,
      (
      WITH recursive r as
      (SELECT 1 level
      union all
      select LEVEL+1 FROM r
      )
      select LEVEL column_value FROM r
      ) i
      WHERE i.column_value<=a.mx
      

      it pops with error/warning "Query execution was interrupted. The query exceeded max_recursive_iterations = 100000. The query result may be incomplete".
      I'd like to lose that unreasonable warning, just like it goes silent in select action. How can I do it?

      Attachments

        Activity

          balta Tadas Balaišis created issue -
          alice Alice Sherepa made changes -
          Field Original Value New Value
          Component/s Optimizer - CTE [ 13513 ]
          serg Sergei Golubchik made changes -
          Priority Blocker [ 1 ] Major [ 3 ]

          you don't really want to disable the warning, because it says that in the second case CTE generates 100,000 rows (and hits the limit), while in the first case it — I suppose — generates only 5, as requested. What you want is the second CTE to generate only 5 rows and not to waste time going all the way to 100,000.

          serg Sergei Golubchik added a comment - you don't really want to disable the warning, because it says that in the second case CTE generates 100,000 rows (and hits the limit), while in the first case it — I suppose — generates only 5, as requested. What you want is the second CTE to generate only 5 rows and not to waste time going all the way to 100,000.

          I'm not as so confident as you are to state what does other person really want. But yes, I want both things. First - that insert /CTAS would work as fast as select does. Second - that warning wouldn't appear.

          balta Tadas Balaišis added a comment - I'm not as so confident as you are to state what does other person really want. But yes, I want both things. First - that insert /CTAS would work as fast as select does. Second - that warning wouldn't appear.

          People

            Unassigned Unassigned
            balta Tadas Balaišis
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.