postgres的EXPLAIN ANALYZE中pg承诺的“持续时间"与执行时间之间的区别? [英] Difference between pg-promise 'duration' and execution time in EXPLAIN ANALYSE of postgres?

查看:418
本文介绍了postgres的EXPLAIN ANALYZE中pg承诺的“持续时间"与执行时间之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用结果"功能的数据对象的持续时间"属性来测量查询的执行时间.

I am using 'duration' property from data object of 'result' function to measure the duration of execution of my query.

我在pgAdmin中使用"EXPLAIN ANALYSE"尝试了相同的查询.

I tried the same query in pgAdmin with "EXPLAIN ANALYSE".

两者都有很大的差异.

谁能说为什么呢?

这是衡量我的查询执行时间的正确方法.

which is the right approach to measure the execution duration of my query.

推荐答案

EXPLAIN ANALYSE仅是服务器内部的性能角度.

EXPLAIN ANALYSE is a performance perspective internal to the server only.

duration由<方法的结果提供c2>包括:

  • 准备执行查询
  • 将查询发送到服务器
  • 由服务器接收并解析查询
  • 执行查询(您的EXPLAIN ANALYSE持续时间)
  • 序列化数据并发送回响应
  • 客户端接收数据
  • 反序列化数据并将其转换为JSON
  • 通知您有关数据的代码
  • preparing the query for execution
  • sending the query into the server
  • receiving and parsing the query by the server
  • executing the query (your EXPLAIN ANALYSE duration)
  • serializing the data and sending the response back
  • receiving data by the client
  • deserializing and converting data into JSON
  • notifying your code about the data

这就是差异的来源.

这篇关于postgres的EXPLAIN ANALYZE中pg承诺的“持续时间"与执行时间之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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