Skip to content

Conversation

@doppleware
Copy link

This PR addresses the critical query performance degradation in the clinic_activity_logs table.

Changes

  • Added B-tree index on the numeric_value column
  • Created new migration file to ensure index is created in all environments

Performance Impact

  • Query performance expected to improve from 2.69 seconds to sub-second response times
  • Will eliminate full table scans on numeric_value queries
  • Should improve buffer cache hit rate (currently at 18.1%)

Related Issues

Testing

  • Index has been tested in development environment
  • Verified query execution plan improvements
  • Monitored buffer cache hit rate improvements

Notes

  • This is a non-blocking change that can be applied without downtime
  • The index will be created using IF NOT EXISTS to ensure idempotency

@doppleware doppleware closed this Jun 3, 2025
@doppleware doppleware deleted the fix-clinic-activity-logs-perf-20240116-created-by-agentic branch June 3, 2025 02:29
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