From bdf7f285d6c9b56359593899f1170f788c40d5f2 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 17 May 2015 14:33:36 +0100 Subject: Add clustering config --- gentoobrowse/datasources/schema.sql | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gentoobrowse/datasources/schema.sql b/gentoobrowse/datasources/schema.sql index d82dae6..fc6c064 100644 --- a/gentoobrowse/datasources/schema.sql +++ b/gentoobrowse/datasources/schema.sql @@ -888,6 +888,8 @@ ALTER TABLE ONLY ebuilds ALTER TABLE ONLY ebuild_archs ADD CONSTRAINT pk_ebuildarch PRIMARY KEY (ebuildid, arch); +ALTER TABLE ebuild_archs CLUSTER ON pk_ebuildarch; + -- -- Name: pk_ebuilddeps; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: @@ -896,6 +898,8 @@ ALTER TABLE ONLY ebuild_archs ALTER TABLE ONLY ebuild_deps ADD CONSTRAINT pk_ebuilddeps PRIMARY KEY (ebuildid, packageid, versionspec, flags, slot, op); +ALTER TABLE ebuild_deps CLUSTER ON pk_ebuilddeps; + -- -- Name: pk_ebuildrdeps; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: @@ -904,6 +908,8 @@ ALTER TABLE ONLY ebuild_deps ALTER TABLE ONLY ebuild_rdeps ADD CONSTRAINT pk_ebuildrdeps PRIMARY KEY (ebuildid, packageid, versionspec, flags, slot, op); +ALTER TABLE ebuild_rdeps CLUSTER ON pk_ebuildrdeps; + -- -- Name: pk_ebuilduses; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: @@ -912,6 +918,8 @@ ALTER TABLE ONLY ebuild_rdeps ALTER TABLE ONLY ebuild_uses ADD CONSTRAINT pk_ebuilduses PRIMARY KEY (ebuildid, use); +ALTER TABLE ebuild_uses CLUSTER ON pk_ebuilduses; + -- -- Name: pk_filecache; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: @@ -944,6 +952,8 @@ ALTER TABLE ONLY files ALTER TABLE ONLY package_changelogs ADD CONSTRAINT pk_package_changelogs PRIMARY KEY (packageid, date, n); +ALTER TABLE package_changelogs CLUSTER ON pk_package_changelogs; + -- -- Name: pk_packagebugs; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: @@ -952,6 +962,8 @@ ALTER TABLE ONLY package_changelogs ALTER TABLE ONLY package_bugs ADD CONSTRAINT pk_packagebugs PRIMARY KEY (packageid, bugid); +ALTER TABLE package_bugs CLUSTER ON pk_packagebugs; + -- -- Name: pk_packagemasks; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: @@ -960,6 +972,8 @@ ALTER TABLE ONLY package_bugs ALTER TABLE ONLY ebuild_masks ADD CONSTRAINT pk_packagemasks PRIMARY KEY (ebuildid, setno, line); +ALTER TABLE ebuild_masks CLUSTER ON pk_packagemasks; + -- -- Name: pk_packagemasksets; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: @@ -992,6 +1006,8 @@ ALTER TABLE ONLY categories ALTER TABLE ONLY package_urls ADD CONSTRAINT pk_pkgurls PRIMARY KEY (packageid, url); +ALTER TABLE package_urls CLUSTER ON pk_pkgurls; + -- -- Name: pk_usegroup; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: @@ -1016,6 +1032,8 @@ ALTER TABLE ONLY user_ebuild_emails ALTER TABLE ONLY user_packages ADD CONSTRAINT pk_userpackages PRIMARY KEY (userid, packageid); +ALTER TABLE user_packages CLUSTER ON pk_userpackages; + -- -- Name: pk_users; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: @@ -1032,6 +1050,8 @@ ALTER TABLE ONLY users ALTER TABLE ONLY ebuilds ADD CONSTRAINT uni_ebuild_pkgver UNIQUE (packageid, version); +ALTER TABLE ebuilds CLUSTER ON uni_ebuild_pkgver; + -- -- Name: uni_files_filename; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: @@ -1048,6 +1068,8 @@ ALTER TABLE ONLY files ALTER TABLE ONLY packages ADD CONSTRAINT uni_pkg_name UNIQUE (categoryid, name); +ALTER TABLE packages CLUSTER ON uni_pkg_name; + -- -- Name: uni_pkggroup_group; Type: CONSTRAINT; Schema: gentoobrowse; Owner: gentoo; Tablespace: @@ -1096,6 +1118,8 @@ ALTER TABLE ONLY use_group ALTER TABLE ONLY use_local ADD CONSTRAINT use_local_pkey PRIMARY KEY (packageid, use); +ALTER TABLE use_local CLUSTER ON use_local_pkey; + -- -- Name: idx_bug_fts; Type: INDEX; Schema: gentoobrowse; Owner: gentoo; Tablespace: -- cgit v1.2.3