如何在Postgres中使用\timing [英] how to use \timing in postgres

查看:735
本文介绍了如何在Postgres中使用\timing的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道在Postgres中执行查询所花费的时间,我看到很多建议使用\timing的响应,但是我是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
thank you in advance

推荐答案

您可以使用 \只能使用命令行客户端 psql 来使,因为这是 psql 命令。

You can use \timing only with the command line client psql, since this is a psql command.

此开关可以打开和关闭执行时间报告:

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.

这篇关于如何在Postgres中使用\timing的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆