How could check the sql statement executed thru xpdo ?
Thanks
Hello there,
we'd like to profile our modx website, to list of the db queries that are made on page refresh.
is there a way that I can use the above to output 'all' the queries made for a particular page?
This way I could have a 'query debug' panel on my page for development that gives the queries made, number of queries etc.
This would be a useful guide for us when caching etc.
Thanks
Jim
-
☆ A M B ☆
- 2,475 Posts
You'd have to do that manually I think.
-
MODX Staff
- 10,725 Posts
At the moment, there is no way (that I am aware of) to catch ALL of the queries executed on the PHP-side via PDO, other than stepping through the PHP application via remote debugging and watching each being executed. If someone else knows how to log all activity for the mysql PDO driver, that would be the best way; I know the SQL Server driver has such a facility, but am not aware of anything like it for mysql.
For now though, your best bet would be to log the activity on the mysql side. You can get a lot more information and analysis on the queries from the database itself. If you want to profile the PHP application, try xDebug's profiling tool.