diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f7aef094b4f..1e0240a2e0f 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -6,6 +6,27 @@ database=h2 spring.sql.init.schema-locations=classpath*:db/${database}/schema.sql spring.sql.init.data-locations=classpath*:db/${database}/data.sql +# Database Configuration +spring.datasource.hikari.maximum-pool-size=10 +spring.datasource.hikari.minimum-idle=5 +spring.datasource.hikari.idle-timeout=300000 +spring.datasource.hikari.connection-timeout=20000 + +# Rate Limiting Configuration +spring.cache.type=caffeine +spring.cache.caffeine.spec=maximumSize=100,expireAfterWrite=5m + +# Query Performance Settings +spring.jpa.properties.hibernate.jdbc.batch_size=30 +spring.jpa.properties.hibernate.order_inserts=true +spring.jpa.properties.hibernate.order_updates=true +spring.jpa.properties.hibernate.batch_versioned_data=true + +# Cache Configuration +spring.jpa.properties.hibernate.cache.use_second_level_cache=true +spring.jpa.properties.hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory +spring.jpa.properties.hibernate.cache.use_query_cache=true + # Web spring.thymeleaf.mode=HTML @@ -28,4 +49,4 @@ logging.level.org.springframework=INFO # logging.level.org.springframework.context.annotation=TRACE # Maximum time static resources should be cached -spring.web.resources.cache.cachecontrol.max-age=12h +spring.web.resources.cache.cachecontrol.max-age=12h \ No newline at end of file diff --git a/src/main/resources/db/migration/V2__Add_patient_weight_index.sql b/src/main/resources/db/migration/V2__Add_patient_weight_index.sql new file mode 100644 index 00000000000..181ecdc1d98 --- /dev/null +++ b/src/main/resources/db/migration/V2__Add_patient_weight_index.sql @@ -0,0 +1,2 @@ +-- Add index on patient_weight column +CREATE INDEX idx_patient_records_weight ON patient_records(patient_weight); \ No newline at end of file