Skip to content

Commit

Permalink
Merge pull request #7529 from IQSS/7398-saved-search-script-reorg
Browse files Browse the repository at this point in the history
7398 saved search script reorg
  • Loading branch information
scolapasta authored Jan 22, 2021
2 parents ebc38c8 + 30144f2 commit 9cc5e85
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
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

0 comments on commit 9cc5e85

Please sign in to comment.