# Trace database queries for your session

Source: https://zotonic.com/docs/2977/trace-database-queries-for-your-session

URI: https://zotonic.com/id/2977

Language: en

Enable module#mod_server_storage if the Development page says it is needed for database tracing. On the Development page, enable Trace all database queries for the current session.

Enable <a href="/id/1307" class="doc-reference doc-reference-module"><code>module#mod_server_storage</code></a> if the Development page says it is needed for database tracing. On the Development page, enable **Trace all database queries for the current session**.

Reproduce one page load or action in that session and inspect the trace output. Look for repeated queries, unexpectedly large result sets, and queries that dominate the request time. A trace from another session may not include your request.

Turn tracing off when finished. Use the evidence to choose a query to investigate; do not add indexes based on query count alone.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/2977?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/2977?language=en>)
