How to Configure Supabase Slow Query Log
You set up a supabase slow query log by turning on database statement timing. Then you check the slow statement records inside your project log view. Most teams use the default admin role to set up these database rules. This broad role lets engineers see slow queries across all schemas at once. Still, sharing that admin password gives too many people full database control. How the supabase slow query log works Every project comes with a default postgres role that holds admin rights. The platf
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You set up a supabase slow query log by turning on database statement timing. Then you check the slow statement records inside your project log view. Most teams use the default admin role to set up these database rules. This broad role lets engineers see slow queries across all schemas at once. Still, sharing that admin password gives too many people full database control.
How the supabase slow query log works
Every project comes with a default postgres role that holds admin rights. The platform does not grant full superuser status to this default role. It blocks superuser status to stop destructive actions on the database. Instead, the platform gives the default role extra rights for specific admin tasks. When you run queries in the dashboard, they run under this admin role. Those dashboard queries also carry a special comment showing they came from the dashboard.
You use this admin role to set a time limit for slow queries. Any statement that runs longer than your limit gets written to the log. Engineers then read the supabase slow query log to find bad indexes. They also use these log entries to spot heavy table scans. The platform advises that you never share the default admin password with outside tools. Instead, you should make a fresh database user for each outside service.
Why native roles leave a gap during query checks
Native roles work well when you only need to control initial login rights. You can create separate database users for each app or team member. You can also limit which tables those users can read or change. This setup stops an app from dropping tables or changing log settings. It keeps basic app traffic in its own lane during normal work.
Still, native setup rules only check who logs into the database at the start. They do not check what single statements do while a session is active. An engineer fixing a slow query often needs to run test reads on live tables. If they log in with the admin role, they can read every column by default. The native log also records raw query text after the query finishes. If a slow query includes an email or card number, that data sits in the log. Native database roles cannot rewrite sensitive fields like phone numbers in query results. They also cannot require a peer to approve a heavy test query before it runs.
End-to-End Encryption + Log Aggregation & Correlation: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Safer ways to check slow database queries
To keep live data safe, teams need controls that work on each query. Engineers should not use the shared admin password for daily query tuning. Each person should log in with their own work identity instead. When an engineer runs a test query, the system should check that command first.
This check lets teams block risky commands before they hit the database engine. It also lets teams mask national IDs or card numbers in the query output. Masking rewrites matched fields in results so raw values do not leak on screen. You get clear audit logs linked to real people, not a shared admin role. Your team can fix slow queries fast while keeping live data safe.
Add query and result controls beside Postgres
Grants and pools govern who logs into PostgreSQL. Yet every query in an open session still runs with that role's full scope. In practice, hoop.dev sits inline in the wire protocol beside your database as a sidecar for your Postgres. For every plain or prepared query an agent or human runs against production, hoop.dev decides to pass, mask, block, or escalate it for review.
When a tool or agent sends SQL, hoop.dev Postgres controls block banned statements before execution or hold risky ones for human approval via an AI Analyzer you configure. Matched sensitive columns in result rows are masked in memory before they reach the caller. Each query and decision is logged per listener, which generates evidence for SOC 2, HIPAA, and GDPR audits. View the binary on GitHub.
Frequently asked questions
Does the default Supabase admin role have full superuser rights?
No, the default postgres role has admin rights, not full superuser rights. The platform blocks superuser access to prevent destructive actions on the database.
Which role runs queries inside the project dashboard?
Queries that you run inside the dashboard execute under the default postgres role. They also include a comment that marks the dashboard as the source.
Should we share the default admin password with monitoring tools?
No, you should keep the default password secret unless you trust the service completely. You should create a dedicated database user for each outside service instead.
Related guides
In this post