Skip to content

Optimize Patient Records Query Performance-created-by-agentic #97

@shaykeren

Description

@shaykeren

This issue addresses performance degradation in the patient records query endpoint.

Current Issues

  1. Missing index on patient_weight column causing full table scans
  2. Sequential query processing without batching
  3. No caching for frequently accessed records
  4. Missing pagination for large result sets

Proposed Changes

  1. Add index on patient_weight column
  2. Implement batch processing for queries
  3. Add query result caching using Spring Cache
  4. Implement proper pagination
  5. Add monitoring for query execution times

Implementation Details

  1. Schema changes:

    • Added index on patient_weight column
  2. Code changes:

    • Added Spring Cache configuration
    • Implemented batch processing
    • Added pagination support
    • Added query execution time monitoring

Testing

  • Performance tests should be run to verify improvements
  • Monitor query execution times before and after changes

Related PRs

  • PR will be created with implementation

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions