[aur-dev] [PATCH] Fix performance issues with new PackageDepends lookups

Dan McGee dan at archlinux.org
Mon Apr 11 21:03:43 EDT 2011


We do a lookup by DepName in the package details view, but I made the
silly mistake of forgetting this index addition in the upgrade steps.

Signed-off-by: Dan McGee <dan at archlinux.org>
---

Lukas- said missing index was the cause of the increased CPU usage/load on
sigurd, it appears. I already created this index in production as I was the one
who forgot it in my last set of patches, whoops!

-Dan

 UPGRADING                     |    4 ++++
 support/schema/aur-schema.sql |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/UPGRADING b/UPGRADING
index da85a8d..7878f63 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -7,6 +7,10 @@ From 1.8.2 to 1.9.0
 1. Translation files are now gettext compatible and need to be compiled after
 each AUR upgrade by running `make install` in the "po/" directory.
 
+2. Fix up issues with depends performance on large dataset.
+
+ALTER TABLE PackageDepends ADD INDEX (DepName);
+
 From 1.8.1 to 1.8.2
 -------------------
 
diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql
index d8c8560..da6a1f9 100644
--- a/support/schema/aur-schema.sql
+++ b/support/schema/aur-schema.sql
@@ -125,6 +125,7 @@ CREATE TABLE PackageDepends (
 	DepName VARCHAR(64) NOT NULL,
 	DepCondition VARCHAR(20),
 	INDEX (PackageID),
+	INDEX (DepName),
 	FOREIGN KEY (PackageID) REFERENCES Packages(ID) ON DELETE CASCADE,
 ) ENGINE = InnoDB;
 
-- 
1.7.4.4



More information about the aur-dev mailing list