Uploaded image for project: 'Pentaho Analysis - Mondrian'
  1. Pentaho Analysis - Mondrian
  2. MONDRIAN-759

use dynamic parameters and PreparedStatement for frequently executed SQL patterns


    • Type: Improvement
    • Status: Open
    • Severity: Medium
    • Resolution: Unresolved
    • Affects Version/s: 3.1.6 (3.5.2 GA Suite Release)
    • Fix Version/s: Not Planned
    • Component/s: Native SQL
    • Labels:
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.


      An example would be this SQL issued for navigating a recursive parent/child hierarchy (captured from the Mondrian unit tests).

      > select "employee"."employee_id" as "c0",
      > "employee"."full_name" as "c1"
      > from "employee" as "employee" where "employee"."supervisor_id" = 187
      > group by "employee"."employee_id", "employee"."full_name" order by
      > "employee"."employee_id" ASC

      The same statement is executed repeatedly, with only the supervisor_id (187) varying. For some DBMS implementations, this can run a lot faster if a prepared statement is used. (For some, such as LucidDB, it doesn't even matter whether the statement is kept around inside of Mondrian; the DBMS can cache the plan even without a prepared statement staying around across executions.)


        There are no comments yet on this issue.


          • Assignee:
            jsichi John Sichi
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: