1 CREATE SEQUENCE page_page_id_seq;
3 page_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('page_page_id_seq'),
4 page_namespace SMALLINT NOT NULL,
5 page_title TEXT NOT NULL,
6 page_restrictions TEXT,
7 page_counter BIGINT NOT NULL DEFAULT 0,
8 page_is_redirect SMALLINT NOT NULL DEFAULT 0,
9 page_is_new SMALLINT NOT NULL DEFAULT 0,
10 page_random NUMERIC(15,14) NOT NULL DEFAULT RANDOM(),
11 page_touched TIMESTAMPTZ,
12 page_latest INTEGER NOT NULL,
13 page_len INTEGER NOT NULL
15 CREATE UNIQUE INDEX page_unique_name ON page (page_namespace, page_title);
16 CREATE INDEX page_main_title ON page (page_title) WHERE page_namespace = 0;
17 CREATE INDEX page_talk_title ON page (page_title) WHERE page_namespace = 1;
18 CREATE INDEX page_user_title ON page (page_title) WHERE page_namespace = 2;
19 CREATE INDEX page_utalk_title ON page (page_title) WHERE page_namespace = 3;
20 CREATE INDEX page_project_title ON page (page_title) WHERE page_namespace = 4;
21 CREATE INDEX page_mediawiki_title ON page (page_title) WHERE page_namespace = 8;
22 CREATE INDEX page_random_idx ON page (page_random);
23 CREATE INDEX page_len_idx ON page (page_len);