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

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.1.2.1, 10.2.1.6
    • Fix Version/s: 10.1.3.1, 10.2.1.6
    • Component/s: SQL
    • Labels:
      None
    • Environment:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: