- run sqlite asynchronously and add sql index files where
authorKlaus Kaempf <kkaempf@suse.de>
Thu, 16 Aug 2007 15:17:13 +0000 (15:17 +0000)
committerKlaus Kaempf <kkaempf@suse.de>
Thu, 16 Aug 2007 15:17:13 +0000 (15:17 +0000)
  appropriate, gives 6x performance on certain operations.
  Bumping cache schema version to 1004.
  (#300998)

package/libzypp.changes
zypp/cache/CacheInitializer.cc
zypp/cache/CacheInitializer.h
zypp/cache/CacheStore.cc
zypp/cache/schema/schema.sql

index 29f8c66..ea62473 100644 (file)
@@ -1,7 +1,17 @@
 -------------------------------------------------------------------
+Thu Aug 16 17:12:45 CEST 2007 - kkaempf@suse.de
+
+- run sqlite asynchronously and add sql index files where
+  appropriate, gives 6x performance on certain operations.
+  Bumping cache schema version to 1004.
+  (#300998)
+- rev 6710
+
+-------------------------------------------------------------------
 Thu Aug 16 17:08:58 CEST 2007 - kkaempf@suse.de
 
 - fix String::endsWith (#301038)
+- rev 6709
 
 -------------------------------------------------------------------
 Thu Aug 16 11:16:25 CEST 2007 - schubi@suse.de
index 86f23df..a896d11 100644 (file)
@@ -52,6 +52,7 @@ CacheInitializer::CacheInitializer( const Pathname &root_r, const Pathname &db_f
   {
      assert_dir( _pimpl->root );
     _pimpl->con.reset( new sqlite3_connection( ( _pimpl->root + db_file).asString().c_str()) );
+    _pimpl->con->executenonquery("pragma synchronous = 0;");
     _pimpl->con->executenonquery("begin;");
     if( ! tablesCreated() )
     {
index 43d7096..2299461 100644 (file)
@@ -19,7 +19,7 @@
 #include "zypp/Pathname.h"
 #include "zypp/cache/sqlite3x/sqlite3x.hpp"
 
-#define ZYPP_CACHE_SCHEMA_VERSION 1003
+#define ZYPP_CACHE_SCHEMA_VERSION 1004
 
 ///////////////////////////////////////////////////////////////////
 namespace zypp
index e8ddd1c..0e12e56 100644 (file)
@@ -141,6 +141,7 @@ struct CacheStore::Impl
 
 
     // disable autocommit
+    con.executenonquery("PRAGMA synchronous = 0;");
     con.executenonquery("BEGIN;");
   }
 
index 44c75e3..e3aabf1 100644 (file)
@@ -10,20 +10,25 @@ DROP TABLE IF EXISTS types;
 DROP TABLE IF EXISTS text_attributes;
 DROP TABLE IF EXISTS split_capabilities;
 DROP TABLE IF EXISTS resolvables_repositories;
+DROP INDEX IF EXISTS resolvables_repository_id_index;
+DROP INDEX IF EXISTS resolvables_shared_id_index;
 DROP TABLE IF EXISTS resolvables;
 DROP TABLE IF EXISTS patch_packages_baseversions;
 DROP TABLE IF EXISTS patch_packages;
 DROP TABLE IF EXISTS other_capabilities;
 DROP TABLE IF EXISTS numeric_attributes;
 DROP TABLE IF EXISTS names;
+DROP INDEX IF EXISTS names_index;
 DROP TABLE IF EXISTS named_capabilities;
 DROP TABLE IF EXISTS modalias_capabilities;
 DROP TABLE IF EXISTS locks;
 DROP TABLE IF EXISTS hal_capabilities;
 DROP TABLE IF EXISTS files;
 DROP TABLE IF EXISTS file_names;
+DROP INDEX IF EXISTS file_names_index;
 DROP TABLE IF EXISTS file_capabilities;
 DROP TABLE IF EXISTS dir_names;
+DROP INDEX IF EXISTS dir_names_index;
 DROP TABLE IF EXISTS delta_packages;
 DROP TABLE IF EXISTS db_info;
 DROP TABLE IF EXISTS repositories;
@@ -72,6 +77,7 @@ CREATE TABLE names (
     id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL
   , name TEXT UNIQUE
 );
+CREATE INDEX names_index ON names(name);
 
 ------------------------------------------------
 -- File names table and normalized sub tables
@@ -81,11 +87,13 @@ CREATE TABLE file_names (
    id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL
   , name TEXT
 );
+CREATE INDEX file_names_index ON file_names(name);
 
 CREATE TABLE dir_names (
    id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL
   , name TEXT
 );
+CREATE INDEX dir_names_index ON dir_names(name);
 
 CREATE TABLE files (
    id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL
@@ -135,6 +143,7 @@ CREATE TABLE resolvables (
   , shared_id INTEGER DEFAULT NULL
 );
 CREATE INDEX resolvable_repository_id ON resolvables(repository_id);
+CREATE INDEX resolvables_shared_id_index ON resolvables(shared_id);
 
 ------------------------------------------------
 -- Do we need those here?