Skip to content
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

7398 saved search script reorg #7529

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/release-notes/7398-saved-search-performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ A refactoring has greatly improved Saved Search performance in the application.

### DB Cleanup for Saved Searches

A previous version of dataverse changed the indexing logic so that when a user links a dataverse, its children are also indexed as linked. This means that the children to not need to be separately linked, and in this version we removed the logic that creates a saved search to create those links when a dataverse is linked.
A previous version of dataverse changed the indexing logic so that when a user links a dataverse, its children are also indexed as linked. This means that the children do not need to be separately linked, and in this version we removed the logic that creates a saved search to create those links when a dataverse is linked.

We recommend cleaning up the db to a) remove these saved searches and b) remove the links for the objects. We can do this via a few queries, which are available in the folder here:

https://github.com/IQSS/dataverse/raw/develop/scripts/issues/7398/

There are four queries available, and they should be run in this order:
There are four sets of queries available, and they should be run in this order:

- ss_for_deletion.txt to identify the Saved Searches to be deleted
- delete_ss.txt to delete the Saved Searches identified in the previous query
- dld_for_deletion.txt to identify the linked datasets and dataverses to be deleted
- delete_dld.txt to delete the linked datasets and dataverses identified in the previous query
- delete_dld.txt to delete the linked datasets and dataverses identified in the previous queries

Note: removing these saved searches and links should not affect what users will see as linked due to the aforementioned indexing change. Similarly, not removing these saved searches and links should not affect anything, but is a cleanup of unnecessary rows in the database.

## Additional Upgrade Instructions

X\. (Optional, but recommended) DB Cleanup

Perform the DB Cleanup for Saved Searches and Linked Objects, summarized in the "Notes for Dataverse Installation Administrators" section above.
Perform the DB Cleanup for Saved Searches and Linked Objects, summarized in the "Notes for Dataverse Installation Administrators" section above.
4 changes: 3 additions & 1 deletion scripts/issues/7398/dld_for_deletion.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
-- this query will show you the linked objects that will get deleted
-- these queries will show you the linked objects that will get deleted

-- datasets
select dld.dataset_id, dvo.owner_id, dld.linkingdataverse_id,
dvld.dataverse_id, dvld.linkingdataverse_id
from datasetlinkingdataverse dld, dvobject dvo, dataverselinkingdataverse dvld
Expand All @@ -8,6 +9,7 @@ and dld.linkingdataverse_id = dvld.linkingdataverse_id
and dvo.owner_id = dvld.dataverse_id
order by dld.linkingdataverse_id;

-- dataverses
select dld.dataverse_id, dvo.owner_id, dld.linkingdataverse_id,
dvld.dataverse_id, dvld.linkingdataverse_id
from dataverselinkingdataverse dld, dvobject dvo, dataverselinkingdataverse dvld
Expand Down