Web lists-archives.com

Re: Automated SQL checker?




Hi Frank,

Enable the slow log on the DB. Any queries which are above the threshold variable ( |long_query_time| <https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_long_query_time> ) will be logged .

Default is 10s, so I assume you'd want to drop this down to 1-2 ( or less ) for a shopcart type response time?

You can then use mysqldumpslow command to aggregate this file after a period of time to identify queries which are greater than long_query_time.

This is typically the first step in analyzing inefficient queries ( or more accurately, queries which are candidates for improvement ) in a running DB. eg

*|mysqldumpslow -s c -t 5 |*

https://dev.mysql.com/doc/refman/5.7/en/mysqldumpslow.html

https://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html

Regards


Ronan McGlue

MySQL Support



On 13/04/2017 01:06, SSC_perl wrote:
On Apr 11, 2017, at 1:26 PM, Michael Munger <michael@xxxxxxxxxxxxxxxxxxx> wrote:

Use MySQL workbench.
	Thanks, Michael.  I played with it some already and it looks like it will give me a lot to work with.

	Will it also let me know if field types are wrong for the given information type, or is that asking for too much?

Frank

https://www.surfshopcart.com

--
Regards

Ronan McGlue
MySQL Support
Oracle Australia