---
title: "Watch live SQL | Speedscale Docs"
description: "Follow your services' PostgreSQL, MySQL and SQL Server statements as they run on the Speedscale Traffic page, like a SQL Server Profiler trace: database columns, trace templates for slow statements, errors, locks and logins, Follow, Clear and Save as snapshot."
canonical: "https://docs.speedscale.com/guides/databases/watch-live-sql/"
---

[Documentation index](https://docs.speedscale.com/guides/llms.txt) | [Markdown](https://docs.speedscale.com/guides/databases/watch-live-sql/index.md) | [Canonical page](https://docs.speedscale.com/guides/databases/watch-live-sql/)

# Watch live SQL

The **Traffic** page can follow a service's database calls as they happen, one row per statement, login or logout, with who ran it, how long it took and how it ended. It works like a SQL Server Profiler trace and covers SQL Server, Postgres and MySQL alike, but it reads the traffic your services already send, so it needs no access to the database, no extended events session and no slow query log.

Use it to watch what a deploy does to the database, to catch the errors, lock waits or slow statements of an incident while it happens, or to see what a feature actually asks of the database while you click through it.

<a id="open-it"></a>

## Open it

1.  On the **Traffic** page, keep a relative time range such as **Last 15 minutes** and auto refresh on.
2.  Filter to the service, and to a database with **L7 Protocol** is `postgres`, `mysql` or `mssql`, or with any **Database** filter.

The grid switches to the database columns: Event, Statement, Application, User, Database, Session, Duration, Rows and Status. The database icon in the toolbar switches between these and the default columns. See [Find statements with filters](https://docs.speedscale.com/guides/databases/find-statements/) for every Database filter.

*   **Event** says what the row is: a statement, an error, a login, a logout, or why the call needs attention, such as a timeout or a deadlock.
*   **Statement** is the statement with its values masked, so repeats of one statement line up. A login or logout reads as the user and database, such as `login traffic → coverage`. When the app writes a route into its SQL comment, the route shows here too.
*   A purple bar on the left marks a statement that ran inside a transaction, and a red one a statement inside a transaction that had already failed.
*   **Duration** turns amber at 50 ms and red at 500 ms, and **Rows** turns amber above 1,000.

<a id="templates"></a>

## Templates

With the database columns on, the **Template** menu starts from a common question instead of an empty filter:

| Template | Shows |
| --- | --- |
| Standard | Every database call |
| Slow statements | Duration 100 ms or more |
| Errors | Calls that returned a database error |
| Cancels and disconnects | Cancelled, timed out and terminated calls, cancel requests and dropped connections |
| Logins and logouts | Login and logout events |
| Locks | Deadlocks and lock timeouts |
| Big results | More than 1,000 rows |

Picking a template replaces the Database and Duration filters and keeps the rest, such as the service, so you can switch between questions about the same service. Change any filter afterwards and the menu reads **Custom**.

![The Traffic toolbar with the Template menu open over the database grid: Standard, Slow statements, Errors, Cancels and disconnects, Logins and logouts, Locks and Big results, each with a one-line description](https://docs.speedscale.com/assets/images/templates-2dc5717201a89b6f0291320620d8b2e8.png)

<a id="follow-clear-and-save-as-snapshot"></a>

## Follow, Clear and Save as snapshot

While the grid is live, a bar above it says whether it is **Live**, **Paused** or **Not following**:

*   **Follow**: new rows appear at the top as they arrive. Turn it off, or scroll away from the top, and new rows are held with a count of how many are waiting; turn it back on to jump to the newest. Opening a row pauses the grid until you close it.
*   **Clear**: hides the rows shown so far and keeps watching, so the grid shows only what happens next, such as the statements of one click in your app. **Show cleared** brings them back.
*   **Save as snapshot**: saves the requests in the grid's window, or the ones since Clear, with the current filters, as a [snapshot](https://docs.speedscale.com/guides/creating-a-snapshot/) you can replay, mock or share.

The right side of the bar shows the rate over the last minute, the row count and how long ago the newest request arrived. When filters narrow what you see, the rate shows both the requests that pass every filter (**shown**) and everything in the selected services and protocols (**seen**), so a quiet stream reads differently from a filtered one.

![The live bar above the database grid: Live, Follow, Clear and Save as snapshot, and 195/min shown, 387 rows, last request 9s ago, over rows of logout, DELETE, COMMIT and INSERT statements on session 210813, with a purple bar on the COMMIT rows](https://docs.speedscale.com/assets/images/live-bar-0f77b4a1d9f385ffcf1587356a6827af.png)

Requests reach the grid about 10 seconds after they happen, the time it takes to capture and index them.

<a id="look-at-one-call"></a>

## Look at one call

Select a row to open it: the statement with its values, how it ended, the login that opened the connection and every other call on that connection. See [Inspect a statement](https://docs.speedscale.com/guides/databases/inspect-a-statement/).

<a id="related"></a>

## Related

*   [Find statements with filters](https://docs.speedscale.com/guides/databases/find-statements/)
*   [Export a SQL script](https://docs.speedscale.com/guides/databases/export-sql-script/)
*   [Watch live SQL in proxymock](https://docs.speedscale.com/proxymock/databases/watch-live-sql/)
