Subject: | Speed improvement on look-ups when using SQLite |
Look-ups for outdated modules (using 'o' command) is quite slow. The
attached patch will create 3 indices on the module table, one each on
the module and version column, one combined on both, to improve this.
Downside to this: The database will almost double in size, and
(re-)creation will take longer since transactions aren't used (yet).
Subject: | cpanp-sqlite-ix.patch |
--- Internals/Source/SQLite.pm.orig 2010-02-17 10:24:25.000000000 +0100
+++ Internals/Source/SQLite.pm 2010-03-22 13:53:42.000000000 +0100
@@ -320,6 +320,45 @@
return;
};
+ $dbh->query( qq[
+ /* the module index */
+ CREATE INDEX IX_module_module ON module (
+ module
+ );
+
+ \n]
+
+ ) or do {
+ error( $dbh->error );
+ return;
+ };
+
+ $dbh->query( qq[
+ /* the version index */
+ CREATE INDEX IX_module_version ON module (
+ version
+ );
+
+ \n]
+
+ ) or do {
+ error( $dbh->error );
+ return;
+ };
+
+ $dbh->query( qq[
+ /* the module-version index */
+ CREATE INDEX IX_module_module_version ON module (
+ module, version
+ );
+
+ \n]
+
+ ) or do {
+ error( $dbh->error );
+ return;
+ };
+
return 1;
}