Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7123920
D8466.id30501.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D8466.id30501.diff
View Options
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -29,12 +29,6 @@
pass_filenames: false
language: system
types: [python]
- - id: check-bumped-dbversion
- name: check-bumped-dbversion
- files: 'sql/upgrades/.*\.sql'
- entry: grep
- args: ["insert into dbversion"]
- language: system
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
diff --git a/swh/storage/postgresql/storage.py b/swh/storage/postgresql/storage.py
--- a/swh/storage/postgresql/storage.py
+++ b/swh/storage/postgresql/storage.py
@@ -108,7 +108,7 @@
class Storage:
"""SWH storage datastore proxy, encompassing DB and object storage"""
- current_version: int = 185
+ current_version: int = 186
def __init__(
self,
diff --git a/swh/storage/sql/60-indexes.sql b/swh/storage/sql/60-indexes.sql
--- a/swh/storage/sql/60-indexes.sql
+++ b/swh/storage/sql/60-indexes.sql
@@ -218,10 +218,7 @@
create unique index concurrently origin_visit_pkey on origin_visit(origin, visit);
alter table origin_visit add primary key using index origin_visit_pkey;
-\if :dbflavor_default
- create index concurrently on origin_visit(date); -- to be reviewed
- create index concurrently origin_visit_type_date on origin_visit(type, date); -- to be reviewed
-\endif
+create index concurrently origin_visit_origin_date_idx on origin_visit (origin, date);
\if :dbflavor_does_deduplication
alter table origin_visit add constraint origin_visit_origin_fkey foreign key (origin) references origin(id) not valid;
diff --git a/swh/storage/sql/upgrades/186.sql b/swh/storage/sql/upgrades/186.sql
new file mode 100644
--- /dev/null
+++ b/swh/storage/sql/upgrades/186.sql
@@ -0,0 +1,9 @@
+-- SWH DB schema upgrade
+-- from_version: 185
+-- to_version: 186
+-- description: Clean up indexes on origin_visit and add proper index for origin_visit_find_by_date
+
+drop index if exists origin_visit_date_idx;
+drop index if exists origin_visit_type_date;
+
+create index concurrently if not exists origin_visit_origin_date_idx on origin_visit(origin, date);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Dec 20 2024, 6:15 AM (11 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3225308
Attached To
D8466: Add date-based index to origin_visit
Event Timeline
Log In to Comment