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

PreparedStatements can take longer to execute than equivalent Statements when there are multiple join conditions mixed with some search clauses.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.1.2.1, 10.2.1.6
    • 10.1.3.1, 10.2.1.6
    • SQL
    • None
    • generic

    Description

      PreparedStatements could take much longer than Statements because of incorrect search clause transitive closure optimization. For the customer case I investigated this problem, Statement would complete in about 13 seconds, where as equivalent PreparedStatement ran "forever". (stoped it after hours)

      I think there a problem with PredicateList.searchClauseTransitiveClosure method. This method tries to add new search clauses based on equality join between tables involved. Current code only looks for ConstantNodes on the right side of searchClauses. This would miss ParameterNodes, so Derby might miss search clause transitive closure optimizations for PreparedStatements.

      Attachments

        1. DERBY-808.patch
          2 kB
          Satheesh E. Bandaram

        Issue Links

          There are no Sub-Tasks for this issue.

          Activity

            People

              bandaram Satheesh E. Bandaram
              bandaram Satheesh E. Bandaram
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: