I am running a sample app based on https://github.com/yahoo/elide-spring-boot-example
I removed all the elide references, added my own domains. Its now a basic spring boot app using hibernate.
I updated the application.yaml with the following in order to
- Use my own SQL Server DB and dialect
- Ignore liquibase changelog
- Ignore ddl-auto
spring:
application:
name: Elide
jpa:
properties:
hibernate:
default_batch_fetch_size: 100
query:
plan_cache_max_size: 64
plan_parameter_metadata_max_size: 32
in_clause_parameter_padding: true
hibernate:
show_sql: true
naming:
physical-strategy: 'misc.CustomPhysicalNamingStrategy'
dialect: 'org.hibernate.dialect.SQLServerDialect'
ddl-auto: 'none'
jdbc:
use_scrollable_resultset: true
datasource:
url: 'jdbc:sqlserver://localhost;databaseName=MYDATABASE'
username: 'username'
password: 'password'
driver-class-name: 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
validation-query: "SELECT 1"
liquibase:
change-log: 'classpath:db/changelog/changelog.xml'
enabled: false
When running the app with debug output, I notice thousands of lines of select statements in the form
Static select for one-to-many ... select ... from AUDIT_DETAIL auditdetai0_ where auditdetai0_.AUDIT_ACTION_TYPE_ID in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Static select for one-to-many ... select ... from AUDIT_DETAIL auditdetai0_ where auditdetai0_.AUDIT_ACTION_TYPE_ID in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Static select for one-to-many ... select ... from AUDIT_DETAIL auditdetai0_ where auditdetai0_.AUDIT_ACTION_TYPE_ID in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Static select for one-to-many ... select ... from AUDIT_DETAIL auditdetai0_ where auditdetai0_.AUDIT_ACTION_TYPE_ID in (?, ?, ?, ?, ?, ?, ?, ?, ?)
I have no specific queries written. I thought it might be the query plan cache as per
Spring + Hibernate: Query Plan Cache Memory usage
but adding the plan_cache_max_size doesnt make any difference. Why are these queries generated, and what should I do to avoid prevent this?