X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fstorage%2Fblob_tracking.sql;h=fbc407c76a270d286f2fb883aa6bf6bf2bd092fa;hb=a3f63785eebfa2f729d42da880b6722736ef1e7d;hp=fe7aadfbdd4b98d108de64979db474d125e68799;hpb=4fcdceb81a162df2d114eff4b09cec19287781c4;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/storage/blob_tracking.sql b/maintenance/storage/blob_tracking.sql index fe7aadfbdd..fbc407c76a 100644 --- a/maintenance/storage/blob_tracking.sql +++ b/maintenance/storage/blob_tracking.sql @@ -4,10 +4,14 @@ CREATE TABLE /*$wgDBprefix*/blob_tracking ( -- page.page_id -- This may be zero for orphan or deleted text + -- Note that this is for compression grouping only -- it doesn't need to be + -- accurate at the time recompressTracked is run. Operations such as a + -- delete/undelete cycle may make it inaccurate. bt_page integer not null, -- revision.rev_id -- This may be zero for orphan or deleted text + -- Like bt_page, it does not need to be accurate when recompressTracked is run. bt_rev_id integer not null, -- text.old_id @@ -28,16 +32,19 @@ CREATE TABLE /*$wgDBprefix*/blob_tracking ( -- True if the text table has been updated to point to bt_new_url bt_moved bool not null default 0, - PRIMARY KEY (bt_rev_id, bt_text_id), + -- Primary key + -- Note that text_id is not unique due to null edits (protection, move) + -- moveTextRow(), commit(), trackOrphanText() + PRIMARY KEY (bt_text_id, bt_rev_id), -- Sort by page for easy CGZ recompression - KEY (bt_moved, bt_page, bt_rev_id), - - -- For fast orphan searches - KEY (bt_text_id), + -- doAllPages(), doAllOrphans(), doPage(), finishIncompleteMoves() + KEY (bt_moved, bt_page, bt_text_id), -- Key for determining the revisions using a given blob + -- Not used by any scripts yet KEY (bt_cluster, bt_blob_id, bt_cgz_hash) + ) /*$wgDBTableOptions*/; -- Tracking table for blob rows that aren't tracked by the text table @@ -47,4 +54,3 @@ CREATE TABLE /*$wgDBprefix*/blob_orphans ( PRIMARY KEY (bo_cluster, bo_blob_id) ) /*$wgDBTableOptions*/; -