Skip to content

O3-5697: Add indexes to queue_entry for queue_id, patient_id & started_at/ended_at#116

Open
UjjawalPrabhat wants to merge 1 commit into
openmrs:mainfrom
UjjawalPrabhat:O3-5697-index-queue-entry
Open

O3-5697: Add indexes to queue_entry for queue_id, patient_id & started_at/ended_at#116
UjjawalPrabhat wants to merge 1 commit into
openmrs:mainfrom
UjjawalPrabhat:O3-5697-index-queue-entry

Conversation

@UjjawalPrabhat
Copy link
Copy Markdown

@UjjawalPrabhat UjjawalPrabhat commented Jun 5, 2026

Summary

The queue_entry table of Service Queues has no indexes on the columns those queries filter by (queue_id, patient_id, started_at, ended_at). Every query therefore scans the entire table.

On a fresh demo install with a handful of patients this is invisible. But in a real clinic with months or years of accumulated queue history (potentially tens of thousands of rows), the queue page gets progressively slower until staff notice it taking seconds to load and by then the table is large enough that adding indexes needs careful migration planning. Indexing it now, while it's small, avoids that.

Related Issue

O3-5697

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 5, 2026

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.

1 participant