Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-3138

Optimizer error when vtis are invoked with correlated references to outer query blocks

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.4.1.3
    • 10.4.1.3
    • SQL
    • None
    • Regression

    Description

      The following query works fine in 10.3, but raises an optimizer error in the mainline:

      select s.schemaname, t.tableName
      from sys.sysschemas s, sys.systables t
      where t.schemaid=s.schemaid
      and exists
      (
      select vti.*
      from table( syscs_diag.space_table( s.schemaname, t.tableName ) ) as vti
      where vti.numfreepages > -1
      )
      ;

      In the mainline, it raises the following error:

      ERROR 42Y69: No valid execution plan was found for this statement. This may have one of two causes: either you specified a hash join strategy when hash join is not allowed (no optimizable equijoin) or you are attempting to join two external virtual tables, each of which references the other, and so the statement cannot be evaluated.

      Attachments

        1. derby-3138-fix-aa.diff
          2 kB
          Richard N. Hillegas

        Issue Links

          Activity

            People

              rhillegas Richard N. Hillegas
              rhillegas Richard N. Hillegas
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: