I need to go over an entire table in Python. I am using MySQLdb via 'SSCursor' and it is much slower than PHP's stuff.
PHP 5.3.5
$result = mysql_query("SELECT * FROM anytable");
while($row = mysql_fetch_assoc($result)){
#do stuff
}
Python2.7
cursor.execute("SELECT * FROM anytable")
for row in cursor:
pass
RESULTS
PHP: 5 seconds CPU around 35%, Python: 25 seconds CPU 100%
Does MySQLdb just suck or am I doing something wrong? If MySQLdb, what can I use instead for better performance/same functionality?