From 27285b94decd7e3ce6e6600ee074e92bd0449f7d Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 24 Feb 2009 23:24:26 +0000 Subject: Replaces COUNT(*) with COUNT(1), which reportedly shows a speed increase on certain tables and views. (Thanks to Marius Ursache for this patch) --- Source/TableContent.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/TableContent.m b/Source/TableContent.m index 045d75ca..5876141c 100644 --- a/Source/TableContent.m +++ b/Source/TableContent.m @@ -1530,10 +1530,10 @@ - (int)fetchNumberOfRows /* - fetches the number of rows in the selected table using a "SELECT COUNT(*)" query and return it + fetches the number of rows in the selected table using a "SELECT COUNT(1)" query and return it */ { - return [[[[mySQLConnection queryString:[NSString stringWithFormat:@"SELECT COUNT(*) FROM `%@`", selectedTable]] fetchRowAsArray] objectAtIndex:0] intValue]; + return [[[[mySQLConnection queryString:[NSString stringWithFormat:@"SELECT COUNT(1) FROM `%@`", selectedTable]] fetchRowAsArray] objectAtIndex:0] intValue]; } -- cgit v1.2.3