[英]how to use \timing in postgres
I want to know the time that it takes to execute a query in Postgres, I see a lot of response that propose to use \\timing, but I'm newbie in Postgres and I don't know how to use it, can anyone help我想知道在 Postgres 中执行查询所需的时间,我看到很多建议使用 \\timing 的响应,但我是 Postgres 的新手,我不知道如何使用它,任何人都可以帮忙
thank you in advance提前谢谢你
You can use \\timing
only with the command line client psql
, since this is a psql
command.您只能将
\\timing
与命令行客户端psql
,因为这是一个psql
命令。
It is a switch that turns execution time reporting on and off:这是一个打开和关闭执行时间报告的开关:
test=> \timing
Timing is on.
test=> SELECT 42;
┌──────────┐
│ ?column? │
├──────────┤
│ 42 │
└──────────┘
(1 row)
Time: 0.745 ms
test=> \timing
Timing is off.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.