Russian Version


In the summary of this part I'd want to recommend following:

Try to find a query which causes inconsistent behavior

Use log files:

  1. General query log
  2. Log files in your application
  3. MySQL Proxy or any other suitable proxy
  4. Others

Analyze what is wrong, then solve the problem using your findings

Below I place a list of methods which we studied in the first part.

Method #1: use output operator to output query in exactly same way in which RDBMS gets it.

Method #2: use general query log if you need to find which exact query causes wrong behavior of your application.

Method #3: after you found a query which causes the problem run it using command line client and analyze result.

Method #4: try to modify SQL in such a way what you get correct result. Use search engines to find a workaround.

Method #5: use EXPLAIN EXTENDED for finding how optimized (and executing) SQL query.

Method #6: convert DML queries to corresponding SELECT to examine which rows will be modified.

Method #7: repeat your scenario backward step-by-step until you found the problem query.

Method #8: always check result of the query! Use means of your connector or interface of interactive client.

Method #9: tune your application in such a way so it will write queries to log files itself.

Method #10: use MySQL Proxy or any other proxy.

Back Content Forward

Author 2010 Sveta Smirnova
COPYRIGHT © 2010 S.Smirnova and S. Lasunov