Improve Reporting - Reminders query performance
Description
Environment
None
Attachments
2
Activity
Show:
Fixed
Details
Details
Assignee

Reporter

Time tracking
5.5h logged
Components
Fix versions
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created December 12, 2022 at 4:24 AM
Updated March 2, 2023 at 10:24 PM
Resolved December 12, 2022 at 7:10 AM
Who's Looking?
On large databases, the Reporting - Reminders - Pending tab performs poorly.
The SQL from which the following is derived ends up doing a table scan on entity_relationships (patient_owner) below. This is an odd choice by the query optimizer, but we don’t have a facility to specify an index hint via the ArchetypeQuery API.
Adding an index on entity_relationships means that the query optimizer no longer selects it, and the query performance improves: