Changeset 16240


Ignore:
Timestamp:
2008-06-27T16:36:27+12:00 (16 years ago)
Author:
mdewsnip
Message:

Added "CREATE INDEX" on document_metadata(docOID) to hugely increase the speed at which large amounts of data get imported -- the nshore-newspapers collection reduced from 879 minutes to less than 5 minutes!

File:
1 edited

Legend:

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

    r16226 r16240  
    251251    print $infodb_handle "CREATE TABLE IF NOT EXISTS data (key TEXT PRIMARY KEY, value TEXT);\n";
    252252    print $infodb_handle "CREATE TABLE IF NOT EXISTS document_metadata (id INTEGER PRIMARY KEY, docOID TEXT, element TEXT, value TEXT);\n";
     253
     254    # This is crucial for efficiency when importing large amounts of data
     255    print $infodb_handle "CREATE INDEX IF NOT EXISTS dmd ON document_metadata(docOID);\n";
    253256
    254257    # This is very important for efficiency, otherwise each command will be actioned one at a time
Note: See TracChangeset for help on using the changeset viewer.