-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter Python CD index results with queries
This is more efficient than a single DELETE statement.
- Loading branch information
1 parent
19fe1d2
commit 0e6259a
Showing
3 changed files
with
15 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- Export the CD5 index for works where one can be calculated | ||
|
||
CREATE INDEX IF NOT EXISTS rolap.valid_cd5index_doi_idx ON valid_cd5index(doi); | ||
|
||
SELECT doi, cdindex FROM rolap.cdindex | ||
INNER JOIN rolap.valid_cd5index USING(doi);; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-- Create a table of publications for which a valid CD5 index can be calculated | ||
|
||
CREATE INDEX IF NOT EXISTS rolap.cdindex_doi_idx ON cdindex(doi); | ||
|
||
CREATE TABLE rolap.valid_cd5index AS | ||
SELECT cdindex.doi FROM rolap.cdindex | ||
INNER JOIN works USING(doi) | ||
WHERE works.published_year <= 2018 AND | ||
(SELECT 1 FROM work_references WHERE work_id == works.id); |