Details
-
Story
-
Status: Closed
-
Should
-
Resolution: Fixed
-
None
-
None
-
None
-
Low
Description
When preparing an identifier criteria using an exact match, the following code is used:
if (matchIdentifierExactly) { conjuction.add(Restrictions.eq("ids.identifier", identifier).ignoreCase()); }
Looking at the underlying query generated by Hibernate, I'm seeing:
where lower(identifier.identifier) = '123ABC'
That is, the "ignoreCase()" option is causing a "lower" to be applied to the identifier column of the patient identifier table, thereby losing the benefit of the index on the identifier column.
When I remove the "ignoreCase()" and test against a production-sized database, doing an exact-match patient identifier lookup improves from taken 1-2 seconds to being almost instantaneous.
This ignoreCase() should also be irrelevant when using a case-insensitive mysql database.
We should not use the ignoreCase() restriction when Context.getAdministrationService().isDatabaseStringComparisonCaseSensitive() is false.
Gliffy Diagrams
Attachments
Issue Links
- depends on
-
TRUNK-4562 Backport AdministrationService.isDatabaseStringComparisonCaseSensitive
-
- Closed
-