cl_timestamp TIMESTAMPTZ NOT NULL
);
CREATE UNIQUE INDEX cl_from ON categorylinks (cl_from, cl_to);
-CREATE INDEX cl_sortkey ON categorylinks (cl_to, cl_sortkey);
+CREATE INDEX cl_sortkey ON categorylinks (cl_to, cl_sortkey, cl_from);
CREATE TABLE externallinks (
el_from INTEGER NOT NULL REFERENCES page(page_id) ON DELETE CASCADE,
UNIQUE KEY cl_from (cl_from,cl_to),
-- We always sort within a given category...
- KEY cl_sortkey (cl_to,cl_sortkey),
+ KEY cl_sortkey (cl_to,cl_sortkey,cl_from),
-- Not really used?
KEY cl_timestamp (cl_to,cl_timestamp)