-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Date range searches include parameter table twice #1624
Comments
It'll happen on any parameter table where the code is included in multiples - e.g. AND with itself. |
If a DATE search parameter is specified more than once on a search query, we will attempt to simplify the search by consolidating the search parameters internally in two ways:
We will process only the
Previously, the generated SQL for this would contain 2 JOINS to the xx_DATE_VALUES table (as documented in the comments above), one for the
NOTES:
|
Confirmed using a test case that it isn't added twice.
|
Describe the bug
Date range search joins the _date_values table twice to get the date_start and date_end values. It should be joined once. Minor performance impact. If there were multiple matching rows for the given parameter name, this would be a functional defect.
To Reproduce
Enable tracing and run the curl search. Inspect trace.log to see the query.
Expected behavior
The query should be rewritten to join against the date-values table just once.
Additional context
Implementing this is likely to be non-trivial given the current complexity of the query-builder. I would not consider implementing this unless:
The text was updated successfully, but these errors were encountered: