Query Logs
Record the database queries your installation runs, see how often each one repeats and which line of code asks for it, so you can find what is slowing a page down.
Opening the Screen
Open Tools, go to the action logs and choose Query Logs: {admin}/tools/query-logs
What Is on the Screen
The settings card sits at the top and stays there. Everything under it appears only once queries have been recorded.
Fields
Tasks
Start recording
- Click Enable on the Query Logging card.
- Put your own address in Valid IP Addresses and click Save, so only your own visits are recorded.
- Use the pages you want to examine, then come back. The entries appear once queries have been recorded.
Find a query that repeats
- Leave the sort on Max per Session; the worst entry is at the top.
- Open it and read Max Per Session. A high figure means one page load ran the same query that many times.
- Open Call Locations. The file, the line and the call stack say which code asks for it.
Hand a query to a developer
- Open the entry and use the copy button inside SQL Query for the query on its own.
- Use Copy Details (JSON) at the top for the whole record, with the locations, the addresses and the recorded values.
Clear the records
- Click Clear All Logs next to the page title. The button appears only where records exist.
- Confirm with Yes, Clear All. Every record is removed and the page reloads.
Things to Watch
While recording is on, every SELECT query costs extra time, because the code behind it is worked out and kept. At the end of each request one file is written per distinct query, and nothing clears them later. Turn it on to investigate something specific, then turn it off and clear the records.
Where the list is not empty, only visits from those addresses are recorded. A list that does not hold your own address leaves the screen empty while logging looks enabled. Check the list first when nothing arrives.
There is no date and no password on this dialog: it removes every recorded query in one step and cannot be undone. Copy the entries you still need before you clear them.
Required Privileges
The screen, the two settings and the clearing action all need the TOOLS_ACTIONS privilege. Without it the page is not shown.
Related Articles
Vielen Dank für Ihre Rückmeldung!
Unser Support-Team ist rund um die Uhr für Sie da, wenn Sie oben nicht fündig werden.