Some initial work on external storage recompression. Committing now in case I acciden...
[lhc/web/wiklou.git] / maintenance / storage / blob_tracking.sql
1
2 -- Table for tracking blobs prior to recompression or similar maintenance operations
3
4 CREATE TABLE /*$wgDBprefix*/blob_tracking (
5 -- page.page_id
6 -- This may be zero for orphan or deleted text
7 bt_page integer not null,
8
9 -- revision.rev_id
10 -- This may be zero for orphan or deleted text
11 bt_rev_id integer not null,
12
13 -- text.old_id
14 bt_text_id integer not null,
15
16 -- The ES cluster
17 bt_cluster varbinary(255),
18
19 -- The ES blob ID
20 bt_blob_id integer not null,
21
22 -- The CGZ content hash, or null
23 bt_cgz_hash varbinary(255),
24
25 PRIMARY KEY (bt_rev_id, bt_text_id),
26
27 -- Sort by page for easy CGZ recompression
28 KEY (bt_page, bt_rev_id),
29
30 -- For fast orphan searches
31 KEY (bt_text_id),
32
33 -- Key for determining the revisions using a given blob
34 KEY (bt_cluster, bt_blob_id, bt_cgz_hash)
35 ) /*$wgDBTableOptions*/;
36