forked from digma-ai/forkof-spring-petclinic
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Performance issue identified in the /query-logs endpoint with severe degradation.
Current Issues
- Missing index on numeric_value column causing full table scans
- No pagination implementation leading to large result sets
- Poor query performance (29s execution time)
- Low buffer cache hit rate
Actions Taken
- Created index on numeric_value column:
CREATE INDEX idx_clinic_activity_logs_numeric_value ON clinic_activity_logs(numeric_value);- Implemented pagination in the getLogs endpoint:
- Added page and pageSize parameters
- Added LIMIT and OFFSET clauses
- Improved query performance to ~10ms
Related PR
See PR #442 for implementation details.
Future Recommendations
- Consider implementing query result caching
- Continue monitoring query performance
- Review other potential slow queries on the same table
- Consider implementing additional indexes based on query patterns
Performance Metrics
- Original query execution time: ~29s
- New query execution time: ~10ms
- Improved buffer cache hit rate
- Reduced memory usage through pagination
Please review and monitor the changes to ensure they meet performance requirements.
Metadata
Metadata
Assignees
Labels
No labels