Changeset 16178


Ignore:
Timestamp:
2008-06-25T14:20:59+12:00 (16 years ago)
Author:
mdewsnip
Message:

Greatly improved SQLite database writing speed by adding "BEGIN TRANSACTION" and "END TRANSACTION" around all the write commands.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/dbutil.pm

    r16177 r16178  
    217217    my $infodb_handle = shift(@_);
    218218
     219    print $infodb_handle "END TRANSACTION;\n";
     220
    219221    close($infodb_handle);
    220222}
     
    245247    print $infodb_handle "CREATE TABLE data (key TEXT, value TEXT, PRIMARY KEY(key));\n";
    246248    print $infodb_handle "CREATE TABLE document_metadata (id INTEGER PRIMARY KEY, docOID TEXT, element TEXT, value TEXT);\n";
     249
     250    # This is very important for efficiency, otherwise each command will be actioned one at a time
     251    print $infodb_handle "BEGIN TRANSACTION;\n";
    247252
    248253    return $infodb_handle;
Note: See TracChangeset for help on using the changeset viewer.