aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMMCPConnection.h
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-06-08 01:00:34 +0000
committerrowanbeentje <rowan@beent.je>2009-06-08 01:00:34 +0000
commit56d7a059dc5ddd905ab58a58c2878eef7fe9c9ea (patch)
tree901971c2f202c79b32d1a945b35adf24c089171f /Source/CMMCPConnection.h
parentda1616e9c31fd922fef7ed567a28dfdd788bcb0c (diff)
downloadsequelpro-56d7a059dc5ddd905ab58a58c2878eef7fe9c9ea.tar.gz
sequelpro-56d7a059dc5ddd905ab58a58c2878eef7fe9c9ea.tar.bz2
sequelpro-56d7a059dc5ddd905ab58a58c2878eef7fe9c9ea.zip
Effectively halve connection lag for queries, speeding up all queries and so interface responsiveness.
- Rework [CMMCPConnection queryString:usingEncoding:] to no longer check the connection before every query. This removes a ping from the equation and therefore effectively halves connection lag. - Move the actual query to a thread (note this is *not* the long-desired multithreading!) to still correctly cope with http://bugs.mysql.com/bug.php?id=9678 . As soon as we upgrade the MySQL client libraries this can be removed, the code simplified, and a further processing speedup will be seen. - When testing a ~10,000 row CSV import (=10,000 queries), the following speedups were observed: - Local server, socket connection: 1.2x speedup - Remove server, 30ms ping: 1.85x speedup Slower connections will observe the biggest benefit from this commit.
Diffstat (limited to 'Source/CMMCPConnection.h')
-rw-r--r--Source/CMMCPConnection.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/CMMCPConnection.h b/Source/CMMCPConnection.h
index 566d628a..962e315a 100644
--- a/Source/CMMCPConnection.h
+++ b/Source/CMMCPConnection.h
@@ -59,6 +59,10 @@
NSString *serverVersionString;
+ NSStringEncoding workerStringEncoding;
+ int workerQueryResultCode;
+ BOOL workerQueryComplete;
+
NSTimer *keepAliveTimer;
NSDate *lastKeepAliveSuccess;
}
@@ -75,10 +79,12 @@
- (BOOL) reconnect;
- (void) setParentWindow:(NSWindow *)theWindow;
- (IBAction) closeSheet:(id)sender;
++ (BOOL) isErrorNumberConnectionError:(int)theErrorNumber;
+ (NSStringEncoding) encodingForMySQLEncoding:(const char *) mysqlEncoding;
- (BOOL) selectDB:(NSString *) dbName;
- (CMMCPResult *) queryString:(NSString *) query;
- (CMMCPResult *) queryString:(NSString *) query usingEncoding:(NSStringEncoding) encoding;
+- (void) workerPerformQuery:(NSString *)theQuery;
- (float) lastQueryExecutionTime;
- (MCPResult *) listDBsLike:(NSString *) dbsName;
- (BOOL) checkConnection;