Skip to content

Commit 05757b6

Browse files
committed
index the sommaires.num column
1 parent c5be4c9 commit 05757b6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

legi/sql/migrations.sql

+4
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,7 @@ CREATE VIEW textes_versions_brutes_view AS
4646
FROM textes_versions a
4747
LEFT JOIN textes_versions_brutes b
4848
ON b.id = a.id AND b.cid = a.cid AND b.dossier = a.dossier AND b.mtime = a.mtime;
49+
50+
-- migration #5
51+
DROP INDEX sommaires_cid_idx;
52+
CREATE INDEX sommaires_cid_num_idx ON sommaires (cid, num);

legi/sql/schema.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CREATE TABLE db_meta
44
, value blob
55
);
66

7-
INSERT INTO db_meta (key, value) VALUES ('schema_version', 3);
7+
INSERT INTO db_meta (key, value) VALUES ('schema_version', 4);
88

99
CREATE TABLE textes
1010
( id integer primary key not null
@@ -95,7 +95,7 @@ CREATE TABLE sommaires
9595
, _source text -- to support incremental updates
9696
);
9797

98-
CREATE INDEX sommaires_cid_idx ON sommaires (cid);
98+
CREATE INDEX sommaires_cid_idx ON sommaires (cid, num);
9999

100100
CREATE TABLE liens
101101
( src_id char(20) not null

0 commit comments

Comments
 (0)