Skip to content

Canceling statement due to "statement timeout"

如果在仪表板遇到 504 或超时错误,请查看这个 指南

你可以运行这个查询来查看为你的角色设置的当前配置:SELECT rolname, rolconfig FROM   pg_roles;

🌐 You can run this query to check the current settings set for your roles: SELECT rolname, rolconfig FROM   pg_roles;

要增加特定角色的 statement_timeout,你可以按照这里的说明操作。请注意,可能需要快速重启才能使更改生效。

🌐 To increase the statement_timeout for a specific role, you may follow the instructions here. Note that it may require a quick reboot for the changes to take effect.

另外,要查看一个查询花了多长时间,你可以查看查询性能报告,它可以为你提供更多关于查询性能的信息:https://app.supabase.com/project/_/advisors/query-performance。你可以对任何已识别出的高消耗查询使用[查询计划分析器](https://www.postgresql.org/docs/current/sql-explain.html): explain analyze <query-statement-here>;。对于 supabase-js/PostgREST 查询,你可以使用 .explain()

你也可以利用 Postgres 日志,它会给你有用的信息,比如查询何时执行:https://app.supabase.com/project/_/logs/postgres-logs。

🌐 You can also make use of Postgres logs that will give you useful information like when the query was executed: https://app.supabase.com/project/_/logs/postgres-logs.