ebean icon indicating copy to clipboard operation
ebean copied to clipboard

FEATURE: NEW: QueryPlanLogger for DB2

Open rPraml opened this issue 1 year ago • 1 comments

This adds a queryPlanLogger for DB2. The reported query-plan is based on this script: http://use-the-index-luke.com/s/last_explained

To generate query-plans, DB2 needs do have explain tables generated with CALL SYSPROC.SYSINSTALLOBJECTS( 'EXPLAIN', 'C' , '', ${SCHEMA})

By default, the selected schema is CURRENT USER. Depending on your DB2 setup, you can control this generation by an additional queryPlan.options config-parameter. Examples:

  • ebean.db.queryPlan.options=create=false do not create the explain tables
  • ebean.db.queryPlan.options=create=true;schema=SYSTOOLS create the explain tables in the SYSTOOLS schema

rPraml avatar Aug 08 '23 10:08 rPraml

I think we need to have a service loading mechanism to load QueryPlanLogger / QueryPlanLoggerFactory ... such that this code can move into the ebean-db2 module instead of being in ebean-core.

rbygrave avatar Feb 27 '24 08:02 rbygrave