How, using Python, can I find how long a MySQL query took? -


i'm connecting mysql mysqldb module. don't want use python's time functions: want know how long query ran within mysql, i.e. number see after i've run query within mysql directly.

i see thread addressed 1 dig down to, hoping since mysql reports number, python connection have picked somewhere.

may help?

set profiling = 1; run query; show profiles; 

see here:http://dev.mysql.com/doc/refman/5.7/en/show-profile.html

Because of the above commands will be removed in the future version,  performance schema can be used http://dev.mysql.com/doc/refman/5.7/en/performance-schema.html and http://dev.mysql.com/doc/refman/5.7/en/performance-schema-query-profiling.html

On the above links, there are more details on query profiling using performance schema. 


Comments