C
C
Crash2016-11-04 20:31:44
Database
Crash, 2016-11-04 20:31:44

What are the tools for debugging database queries?

We set the task of optimizing a self-written site in PHP. It works slowly and I suspect that the issue here is in queries to the database. Please tell me the tools with which they can be tracked, for example, as in Yii2:
4491d3ff48414cc082baf51da2b3c411.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2016-11-04
@Bandicoot

From the DBMS side:
Postgresql: pg_stat_statements
https://www.postgresql.org/docs/current/static/pgs...
Mysql: slow query log
dev.mysql.com/doc/refman/5.7/en/slow-query- log.html
For others, they don’t know, well, since even mysql has at least something, then others will definitely have something.
From the PHP side - xdebug + kcachegrind will tell you exactly where you are wasting time for a particular request and how you got there. To monitor the combat system as a whole, look towards pinba.
From the project code itself - the subd access libraries are not directly involved in profiling. Therefore, you need to look at a specific project, is there a place where you can stick query profiling.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question