Skip to content

Commit 113ba91

Browse files
committed
Merge branch 'release/v0.13.2'
2 parents 7220df4 + d1cfad1 commit 113ba91

File tree

12 files changed

+241
-32
lines changed

12 files changed

+241
-32
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [[0.13.2]](https://github.com/thoth-pub/thoth/releases/tag/v0.13.2) - 2024-11-26
10+
### Added
11+
- [656](https://github.com/thoth-pub/thoth/pull/656) - Add database indexes to common attributes to improve performance
12+
913
## [[0.13.1]](https://github.com/thoth-pub/thoth/releases/tag/v0.13.1) - 2024-11-25
1014
### Added
1115
- [593](https://github.com/thoth-pub/thoth/issues/593) - Log GraphQL queries alongside request logs

Cargo.lock

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth"
3-
version = "0.13.1"
3+
version = "0.13.2"
44
authors = ["Javier Arias <javi@thoth.pub>", "Ross Higman <ross@thoth.pub>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -15,11 +15,11 @@ maintenance = { status = "actively-developed" }
1515
members = ["thoth-api", "thoth-api-server", "thoth-app", "thoth-app-server", "thoth-client", "thoth-errors", "thoth-export-server"]
1616

1717
[dependencies]
18-
thoth-api = { version = "=0.13.1", path = "thoth-api", features = ["backend"] }
19-
thoth-api-server = { version = "=0.13.1", path = "thoth-api-server" }
20-
thoth-app-server = { version = "=0.13.1", path = "thoth-app-server" }
21-
thoth-errors = { version = "=0.13.1", path = "thoth-errors" }
22-
thoth-export-server = { version = "=0.13.1", path = "thoth-export-server" }
18+
thoth-api = { version = "=0.13.2", path = "thoth-api", features = ["backend"] }
19+
thoth-api-server = { version = "=0.13.2", path = "thoth-api-server" }
20+
thoth-app-server = { version = "=0.13.2", path = "thoth-app-server" }
21+
thoth-errors = { version = "=0.13.2", path = "thoth-errors" }
22+
thoth-export-server = { version = "=0.13.2", path = "thoth-export-server" }
2323
clap = { version = "4.5.16", features = ["cargo", "env"] }
2424
dialoguer = { version = "0.11.0", features = ["password"] }
2525
dotenv = "0.15.0"

thoth-api-server/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-api-server"
3-
version = "0.13.1"
3+
version = "0.13.2"
44
authors = ["Javier Arias <javi@thoth.pub>", "Ross Higman <ross@thoth.pub>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -9,8 +9,8 @@ repository = "https://github.com/thoth-pub/thoth"
99
readme = "README.md"
1010

1111
[dependencies]
12-
thoth-api = { version = "=0.13.1", path = "../thoth-api", features = ["backend"] }
13-
thoth-errors = { version = "=0.13.1", path = "../thoth-errors" }
12+
thoth-api = { version = "=0.13.2", path = "../thoth-api", features = ["backend"] }
13+
thoth-errors = { version = "=0.13.2", path = "../thoth-errors" }
1414
actix-web = "4.9"
1515
actix-cors = "0.7.0"
1616
actix-http = "3.9.0"

thoth-api/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-api"
3-
version = "0.13.1"
3+
version = "0.13.2"
44
authors = ["Javier Arias <javi@thoth.pub>", "Ross Higman <ross@thoth.pub>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -15,7 +15,7 @@ maintenance = { status = "actively-developed" }
1515
backend = ["diesel", "diesel-derive-enum", "diesel_migrations", "futures", "actix-web", "jsonwebtoken", "deadpool-redis"]
1616

1717
[dependencies]
18-
thoth-errors = { version = "=0.13.1", path = "../thoth-errors" }
18+
thoth-errors = { version = "=0.13.2", path = "../thoth-errors" }
1919
actix-web = { version = "4.8", optional = true }
2020
argon2rs = "0.2.5"
2121
isbn2 = "0.4.0"

thoth-api/migrations/v0.13.1/down.sql

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
-- Remove indexes from account table
2+
DROP INDEX IF EXISTS idx_account_email;
3+
4+
-- Remove indexes from publisher_account table
5+
DROP INDEX IF EXISTS idx_publisher_account_account_id;
6+
7+
-- Remove indexes from work table
8+
DROP INDEX IF EXISTS idx_work_doi;
9+
DROP INDEX IF EXISTS idx_work_reference;
10+
DROP INDEX IF EXISTS idx_work_short_abstract_substr;
11+
DROP INDEX IF EXISTS idx_work_long_abstract_substr;
12+
DROP INDEX IF EXISTS idx_work_landing_page;
13+
DROP INDEX IF EXISTS idx_work_imprint_id;
14+
DROP INDEX IF EXISTS idx_work_updated_at_with_relations_desc;
15+
DROP INDEX IF EXISTS idx_work_full_title_asc;
16+
DROP INDEX IF EXISTS idx_work_publication_date_asc;
17+
DROP INDEX IF EXISTS idx_work_publication_date_desc;
18+
DROP INDEX IF EXISTS idx_work_type_status_pub_date_desc;
19+
DROP INDEX IF EXISTS idx_work_books_pub_date_desc;
20+
21+
-- Remove indexes from work_relation table
22+
DROP INDEX IF EXISTS idx_work_relation_relation_ordinal_relator_relation_type_asc;
23+
DROP INDEX IF EXISTS idx_work_relation_relation_ordinal_related_relation_type_asc;
24+
25+
-- Remove indexes from publisher table
26+
DROP INDEX IF EXISTS idx_publisher_publisher_name;
27+
DROP INDEX IF EXISTS idx_publisher_publisher_shortname;
28+
29+
-- Remove indexes from imprint table
30+
DROP INDEX IF EXISTS idx_imprint_imprint_name;
31+
DROP INDEX IF EXISTS idx_imprint_imprint_url;
32+
DROP INDEX IF EXISTS idx_imprint_publisher_id;
33+
34+
-- Remove indexes from subject table
35+
DROP INDEX IF EXISTS idx_subject_subject_code_asc;
36+
DROP INDEX IF EXISTS idx_subject_subject_ordinal_asc;
37+
38+
-- Remove indexes from publication table
39+
DROP INDEX IF EXISTS idx_publication_work_id;
40+
DROP INDEX IF EXISTS idx_publication_isbn;
41+
DROP INDEX IF EXISTS idx_publication_publication_type;
42+
43+
-- Remove indexes from location table
44+
DROP INDEX IF EXISTS idx_location_location_platform_asc;
45+
46+
-- Remove indexes from price table
47+
DROP INDEX IF EXISTS idx_price_currency_code_asc;
48+
49+
-- Remove indexes from contributor table
50+
DROP INDEX IF EXISTS idx_contributor_full_name;
51+
DROP INDEX IF EXISTS idx_contributor_last_name;
52+
DROP INDEX IF EXISTS idx_contributor_orcid;
53+
54+
-- Remove indexes from contribution table
55+
DROP INDEX IF EXISTS idx_contribution_work_id;
56+
DROP INDEX IF EXISTS idx_contribution_contributor_id;
57+
DROP INDEX IF EXISTS idx_contribution_ordinal_asc;
58+
59+
-- Remove indexes from affiliation table
60+
DROP INDEX IF EXISTS idx_affiliation_contribution_id;
61+
DROP INDEX IF EXISTS idx_affiliation_ordinal_asc;
62+
63+
-- Remove indexes from institution table
64+
DROP INDEX IF EXISTS idx_institution_institution_name;
65+
DROP INDEX IF EXISTS idx_institution_ror;
66+
DROP INDEX IF EXISTS idx_institution_institution_doi;
67+
68+
-- Remove indexes from funding table
69+
DROP INDEX IF EXISTS idx_funding_work_id;
70+
DROP INDEX IF EXISTS idx_funding_program;
71+
72+
-- Remove indexes from series table
73+
DROP INDEX IF EXISTS idx_series_series_name;
74+
DROP INDEX IF EXISTS idx_series_issn_print;
75+
DROP INDEX IF EXISTS idx_series_issn_digital;
76+
DROP INDEX IF EXISTS idx_series_series_url;
77+
DROP INDEX IF EXISTS idx_series_series_description;
78+
DROP INDEX IF EXISTS idx_series_imprint_id;
79+
80+
-- Remove indexes from issue table
81+
DROP INDEX IF EXISTS idx_issue_ordinal_work_id_asc;
82+
DROP INDEX IF EXISTS idx_issue_ordinal_series_id_asc;
83+
84+
-- Remove indexes from language table
85+
DROP INDEX IF EXISTS idx_language_language_code_asc;
86+
87+
-- Remove indexes from reference table
88+
DROP INDEX IF EXISTS idx_reference_work_id;
89+
DROP INDEX IF EXISTS idx_reference_doi;
90+
DROP INDEX IF EXISTS idx_reference_unstructured_citation;
91+
DROP INDEX IF EXISTS idx_reference_issn;
92+
DROP INDEX IF EXISTS idx_reference_isbn;
93+
DROP INDEX IF EXISTS idx_reference_journal_title;
94+
DROP INDEX IF EXISTS idx_reference_article_title;
95+
DROP INDEX IF EXISTS idx_reference_series_title;
96+
DROP INDEX IF EXISTS idx_reference_volume_title;
97+
DROP INDEX IF EXISTS idx_reference_author_substr;
98+
DROP INDEX IF EXISTS idx_reference_standard_designator;
99+
DROP INDEX IF EXISTS idx_reference_standards_body_name;
100+
DROP INDEX IF EXISTS idx_reference_standards_body_acronym;

thoth-api/migrations/v0.13.1/up.sql

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
-- Indexes account table
2+
CREATE INDEX idx_account_email ON account (email);
3+
4+
-- Indexes publisher_account table
5+
CREATE INDEX idx_publisher_account_account_id ON publisher_account (account_id);
6+
7+
-- Indexes work table
8+
CREATE INDEX idx_work_doi ON work (doi);
9+
CREATE INDEX idx_work_reference ON work (reference);
10+
CREATE INDEX idx_work_short_abstract_substr ON work (substring(short_abstract FROM 1 FOR 255));
11+
CREATE INDEX idx_work_long_abstract_substr ON work (substring(long_abstract FROM 1 FOR 255));
12+
CREATE INDEX idx_work_landing_page ON work (landing_page);
13+
CREATE INDEX idx_work_imprint_id ON work (imprint_id);
14+
CREATE INDEX idx_work_updated_at_with_relations_desc ON work (updated_at_with_relations DESC, work_id);
15+
CREATE INDEX idx_work_full_title_asc ON work (full_title ASC, work_id);
16+
CREATE INDEX idx_work_publication_date_asc ON work (publication_date ASC, work_id);
17+
CREATE INDEX idx_work_publication_date_desc ON work (publication_date DESC, work_id);
18+
CREATE INDEX idx_work_type_status_pub_date_desc
19+
ON work (work_type, work_status, publication_date DESC);
20+
CREATE INDEX idx_work_books_pub_date_desc
21+
ON work (publication_date DESC)
22+
WHERE work_type IN ('monograph', 'edited-book', 'textbook') AND work_status = 'active';
23+
24+
-- Indexes work_relation table
25+
CREATE INDEX idx_work_relation_relation_ordinal_relator_relation_type_asc
26+
ON work_relation (relation_ordinal ASC, relator_work_id, relation_type);
27+
CREATE INDEX idx_work_relation_relation_ordinal_related_relation_type_asc
28+
ON work_relation (relation_ordinal ASC, related_work_id, relation_type);
29+
30+
-- Indexes publisher table
31+
CREATE INDEX idx_publisher_publisher_name ON publisher (publisher_name);
32+
CREATE INDEX idx_publisher_publisher_shortname ON publisher (publisher_shortname);
33+
34+
-- Indexes imprint table
35+
CREATE INDEX idx_imprint_imprint_name ON imprint (imprint_name);
36+
CREATE INDEX idx_imprint_imprint_url ON imprint (imprint_url);
37+
CREATE INDEX idx_imprint_publisher_id ON imprint (publisher_id);
38+
39+
-- Indexes subject table
40+
CREATE INDEX idx_subject_subject_code_asc ON subject (subject_code ASC, work_id);
41+
CREATE INDEX idx_subject_subject_ordinal_asc ON subject (subject_ordinal ASC, work_id);
42+
43+
-- Indexes publication table
44+
CREATE INDEX idx_publication_work_id ON publication (work_id);
45+
CREATE INDEX idx_publication_isbn ON publication (isbn);
46+
CREATE INDEX idx_publication_publication_type ON publication (publication_type);
47+
48+
-- Indexes location table
49+
CREATE INDEX idx_location_location_platform_asc ON location (location_platform ASC, publication_id);
50+
51+
-- Indexes price table
52+
CREATE INDEX idx_price_currency_code_asc ON price (currency_code ASC, publication_id);
53+
54+
-- Indexes contributor table
55+
CREATE INDEX idx_contributor_full_name ON contributor (full_name);
56+
CREATE INDEX idx_contributor_last_name ON contributor (last_name);
57+
CREATE INDEX idx_contributor_orcid ON contributor (orcid);
58+
59+
-- Indexes contribution table
60+
CREATE INDEX idx_contribution_work_id ON contribution (work_id);
61+
CREATE INDEX idx_contribution_contributor_id ON contribution (contributor_id);
62+
CREATE INDEX idx_contribution_ordinal_asc ON contribution (contribution_ordinal ASC, work_id);
63+
64+
-- Indexes affiliation table
65+
CREATE INDEX idx_affiliation_contribution_id ON affiliation (contribution_id);
66+
CREATE INDEX idx_affiliation_ordinal_asc ON affiliation (affiliation_ordinal ASC, contribution_id);
67+
68+
-- Indexes contributor table
69+
CREATE INDEX idx_institution_institution_name ON institution (institution_name);
70+
CREATE INDEX idx_institution_ror ON institution (ror);
71+
CREATE INDEX idx_institution_institution_doi ON institution (institution_doi);
72+
73+
-- Indexes funding table
74+
CREATE INDEX idx_funding_work_id ON funding (work_id);
75+
CREATE INDEX idx_funding_program ON funding (program);
76+
77+
-- Indexes series table
78+
CREATE INDEX idx_series_series_name ON series (series_name);
79+
CREATE INDEX idx_series_issn_print ON series (issn_print);
80+
CREATE INDEX idx_series_issn_digital ON series (issn_digital);
81+
CREATE INDEX idx_series_series_url ON series (series_url);
82+
CREATE INDEX idx_series_series_description ON series (series_description);
83+
CREATE INDEX idx_series_imprint_id ON series (imprint_id);
84+
85+
-- Indexes issue table
86+
CREATE INDEX idx_issue_ordinal_work_id_asc ON issue (issue_ordinal ASC, work_id);
87+
CREATE INDEX idx_issue_ordinal_series_id_asc ON issue (issue_ordinal ASC, series_id);
88+
89+
-- Indexes language table
90+
CREATE INDEX idx_language_language_code_asc ON language (language_code ASC, work_id);
91+
92+
-- Indexes reference table
93+
CREATE INDEX idx_reference_work_id ON reference (work_id);
94+
CREATE INDEX idx_reference_doi ON reference (doi);
95+
CREATE INDEX idx_reference_unstructured_citation ON reference (unstructured_citation);
96+
CREATE INDEX idx_reference_issn ON reference (issn);
97+
CREATE INDEX idx_reference_isbn ON reference (isbn);
98+
CREATE INDEX idx_reference_journal_title ON reference (journal_title);
99+
CREATE INDEX idx_reference_article_title ON reference (article_title);
100+
CREATE INDEX idx_reference_series_title ON reference (series_title);
101+
CREATE INDEX idx_reference_volume_title ON reference (volume_title);
102+
CREATE INDEX idx_reference_author_substr ON reference ((substring(author FROM 1 FOR 255)));
103+
CREATE INDEX idx_reference_standard_designator ON reference (standard_designator);
104+
CREATE INDEX idx_reference_standards_body_name ON reference (standards_body_name);
105+
CREATE INDEX idx_reference_standards_body_acronym ON reference (standards_body_acronym);

thoth-app-server/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-app-server"
3-
version = "0.13.1"
3+
version = "0.13.2"
44
authors = ["Javier Arias <javi@thoth.pub>", "Ross Higman <ross@thoth.pub>"]
55
edition = "2021"
66
license = "Apache-2.0"

thoth-app/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-app"
3-
version = "0.13.1"
3+
version = "0.13.2"
44
authors = ["Javier Arias <javi@thoth.pub>", "Ross Higman <ross@thoth.pub>"]
55
edition = "2021"
66
license = "Apache-2.0"
@@ -35,8 +35,8 @@ uuid = { version = "1.10.0", features = ["serde", "v4"] }
3535
# `getrandom` is a dependency of `uuid`, we need to explicitly import and include the `js` feature to enable wasm
3636
# https://docs.rs/getrandom/latest/getrandom/#webassembly-support
3737
getrandom = { version = "0.2", features = ["js"] }
38-
thoth-api = { version = "=0.13.1", path = "../thoth-api" }
39-
thoth-errors = { version = "=0.13.1", path = "../thoth-errors" }
38+
thoth-api = { version = "=0.13.2", path = "../thoth-api" }
39+
thoth-errors = { version = "=0.13.2", path = "../thoth-errors" }
4040

4141
[build-dependencies]
4242
dotenv = "0.15.0"

0 commit comments

Comments
 (0)