From 2cc9562fd2ee8c57e835fdd5291184c830ef8e23 Mon Sep 17 00:00:00 2001
From: Thorbjørn Lindeijer <thorbjorn@lindeijer.nl>
Date: Sat, 15 Dec 2012 22:44:06 +0100
Subject: Create database using a single transaction

Takes the time required to do initial database creation down from
16 to 0.2 seconds on the Raspberry Pi.
---
 src/sql/sqlite/createTables.sql | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'src/sql/sqlite/createTables.sql')

diff --git a/src/sql/sqlite/createTables.sql b/src/sql/sqlite/createTables.sql
index 06dbd19..d845e84 100644
--- a/src/sql/sqlite/createTables.sql
+++ b/src/sql/sqlite/createTables.sql
@@ -18,6 +18,8 @@
 -- along with The Mana Server.  If not, see <http://www.gnu.org/licenses/>.
 --
 
+BEGIN;
+
 -----------------------------------------------------------------------------
 -- Tables
 -----------------------------------------------------------------------------
@@ -480,3 +482,5 @@ INSERT INTO mana_transaction_codes VALUES ( 51, 'Command RESTART_THIS',     'Com
 INSERT INTO mana_transaction_codes VALUES ( 52, 'Command RESTART_ALL',      'Commands' );
 INSERT INTO mana_transaction_codes VALUES ( 53, 'Command ATTRIBUTE',        'Commands' );
 INSERT INTO mana_transaction_codes VALUES ( 54, 'Command KICK',             'Commands' );
+
+END;
-- 
cgit 

