postgres库-----查看sql执行时间
来源:互联网 发布:无尽的传说2 mac 编辑:程序博客网 时间:2024/06/02 00:41
postgres 数据库查看sql的执行时间:
方法一;
\timing on
你的sql语句不再使用时:
\timing off
方法二: 查看执行计划
explain select count(*) from 你的表;
QUERY PLAN
------------------------------------------------------------------------------------
Aggregate (cost=14798.38..14798.39 rows=1 width=0)
-> Seq Scan on 你的表 (cost=0.00..14423.10 rows=150110 width=0)
(2 rows)
cost=说明:
- 第一个数字0.00表示启动cost,这是执行到返回第一行时需要的cost值。
- 第二个数字14423.10表示执行整个SQL的cost
explain后加analyze来通过真实执行这个SQL来获得真实的执行计划和执行时间
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------
Aggregate (cost=14798.38..14798.39 rows=1 width=0) (actual time=73.336..73.336 rows=1 loops=1)
-> Seq Scan on cancellations_changes (cost=0.00..14423.10 rows=150110 width=0) (actual time=0.009..47.861 rows=146938loops=1)
Total runtime: 73.379 ms
(3 rows)
详细参考;
http://blog.csdn.net/ls3648098/article/details/7602136
0 0
- postgres库-----查看sql执行时间
- Postgres log_duration设置记录SQL执行时间
- 查看sql语句执行时间
- 查看SQL执行时间
- 查看sql执行时间方式
- 查看SQL语句执行时间
- SQL SERVER 查看语句执行时间
- 查看SQL语句的执行时间
- 查看SQL语句的执行时间
- 查看SQL语句的执行时间
- 查看SQL语句的执行时间
- 查看Sql语句的执行时间
- sqlplus查看sql语句执行时间
- Sql server 查看语句执行时间
- 查看SQL语句的执行时间
- 查看sql语句的执行时间
- Mysql查看sql的执行时间
- SQL 语句执行时间及IO情况查看
- Maven发布项目到Tomcat7中
- Linux内存管理
- Mysql优化
- Hdoj 1251 统计难题 【Hash】
- AutoCAD2008对应的acad.rx文件
- postgres库-----查看sql执行时间
- 安卓下 按钮监听重复开启线程
- 序列化
- mongodb的安装和使用
- hdoj 1719 Friend(找规律)
- @DynamicInsert和@DynamicUpdate的使用
- 双引号和单引号的区别
- HDU 2467 Déjà vu IDA*
- Ubuntu下安装配置JDK