Changeset 16223

Show
Ignore:
Timestamp:
27.06.2008 14:45:21 (12 years ago)
Author:
mdewsnip
Message:

Added a couple of comments and now creates an index on the document_metadata table's "element" field, to greatly improve the speed of queries.

Files:
1 modified

Legend:

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

    r16178 r16223  
    217217    my $infodb_handle = shift(@_); 
    218218 
     219    # Close the transaction we began after opening the file 
    219220    print $infodb_handle "END TRANSACTION;\n"; 
     221 
     222    # This is crucial for efficient queries on the database! 
     223    print $infodb_handle "CREATE INDEX dme ON document_metadata(element);\n"; 
    220224 
    221225    close($infodb_handle); 
     
    245249    } 
    246250 
    247     print $infodb_handle "CREATE TABLE data (key TEXT, value TEXT, PRIMARY KEY(key));\n"; 
     251    print $infodb_handle "CREATE TABLE data (key TEXT PRIMARY KEY, value TEXT);\n"; 
    248252    print $infodb_handle "CREATE TABLE document_metadata (id INTEGER PRIMARY KEY, docOID TEXT, element TEXT, value TEXT);\n"; 
    249253