Skip to content

Conversation

rPraml
Copy link
Contributor

@rPraml rPraml commented Aug 8, 2023

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 added a commit to FOCONIS/ebean that referenced this pull request Aug 10, 2023
@rbygrave
Copy link
Member

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.

@rPraml rPraml force-pushed the query-plan-logger-for-db2 branch from 04b49f2 to 841aaf8 Compare October 7, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants