Add INDEX for zLastUsed for performance
Showing
1 changed file
with
1 additions
and
0 deletions
@@ -37,6 +37,7 @@ | @@ -37,6 +37,7 @@ | ||
37 | { | 37 | { |
38 | // [db executeUpdate:@"DROP TABLE ZCACHE"]; | 38 | // [db executeUpdate:@"DROP TABLE ZCACHE"]; |
39 | [db executeUpdate:@"CREATE TABLE IF NOT EXISTS ZCACHE (ztileHash INTEGER PRIMARY KEY, zlastUsed DOUBLE, zdata BLOB)"]; | 39 | [db executeUpdate:@"CREATE TABLE IF NOT EXISTS ZCACHE (ztileHash INTEGER PRIMARY KEY, zlastUsed DOUBLE, zdata BLOB)"]; |
40 | + [db executeUpdate:@"CREATE INDEX zlastUsedIndex ON ZCACHE(zLastUsed)"]; | ||
40 | } | 41 | } |
41 | 42 | ||
42 | -(id) initWithDatabase: (NSString*)path | 43 | -(id) initWithDatabase: (NSString*)path |
-
Please register or login to post a comment