-
Notifications
You must be signed in to change notification settings - Fork 157
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
Support IS_DELETED status on xxx_LOGICAL_RESOURCES tables #1958
Comments
stretch goal for 4.6.0 |
The column is now added to each xxx_LOGICAL_RESOURCES table. When the column is added, we use DEFAULT 'X'. The schema-tool migration will then run a correlated update to set this value to match the deletion status for the current resource. The stored procedures then keep this value updated for new and updated resources. To verify, before upgrading the schema to the 4.6.0 release version perform the following steps (can be any resource type, I'm just using patient as an example: CREATE a new patient and take note of its logical id == patient-1; CREATE another patient and take note of its logical id == patient-2 Now perform the schema upgrade to 4.6.0. With the new FHIR server: CREATE a new patient == patient-3 CREATE a new patient == patient-4 At a SQL prompt, run the following statement to get the is_deleted flag value. If you are using Db2, then remember to run
This result should be 0. In the following commands change the logical_id value to match the values you actually used or recorded for the 4 patients:
|
On our test database with ~10M resources, it took about 100 seconds to add the IS_DELETED columns and populate them from the DB. |
Verified migration from 4.5.4 to latest is working according to the above acceptance Criteria. |
I have created/deleted resources via postman in my local derby database and have verified through the ij tool that the is_deleted flag is being set properly. |
There's an issue with the migration implementation for Derby which doesn't support correlated update statements. The fix is to select the current values for each resource and apply individual updates using JDBC batches (in class InitializeLogicalIdIsDeleted). |
verified 4.5.4 to latest is also working in Derby. |
Is your feature request related to a problem? Please describe.
Search queries currently have to join to the xxx_RESOURCES table to check the value of the IS_DELETED flag for the current resource. This is particularly expensive because the xxx_RESOURCES table also contains the payload data column which is frequently stored inline in the row if it's not too big...but because the payload data is fairly big, this reduces the row density within a block and probably leads to more IO than expected.
By adding the current deletion status to the xxx_LOGICAL_RESOURCES table it is possible to remove the xxx_RESOURCES table from each parameter join. This simplifies the query, and because xxx_LOGICAL_RESOURCES is smaller, it is easier to keep cached which will result in much better performance for more complex searches.
Describe the solution you'd like
The text was updated successfully, but these errors were encountered: