zoukankan      html  css  js  c++  java
  • Postgres性能检测

    # top -c
    PID USER     PRI NI SIZE RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
    14442 postgres 25   0 47632 46M 44468 R     7.2 1.1   0:03   0 postgres: postgres gudumami 192.168.2.206(45351) SELECT
    13834 postgres 16   0 88992 86M 86408 S     1.8 2.1   2:02   0 postgres: postgres gudumami 192.168.2.206(45158) idle
    13806 postgres 15   0 88956 86M 86464 S     1.2 2.1   2:58   0 postgres: postgres gudumami 192.168.2.206(45094) idle
    25132 postgres 15   0 90656 88M 86972 S     0.4 2.1 1107m   0 postgres: postgres gudumami 192.168.2.206(33654) idle
    21720 postgres 15   0 2272 2268 1680 S     0.2 0.0 288:27   1 postgres: stats collector process
    21718 postgres 15   0 85660 83M 84944 S     0.1 2.0 363:52   0 postgres: writer process


    用explain来看看他的execute plan
    gudumami=#explain select * from user_basic where user_id='coffeehan';

    ps -ef | grep postgres

    SELECT pg_stat_get_backend_pid(s.backendid) AS procpid,
           pg_stat_get_backend_activity(s.backendid) AS current_query
        FROM (SELECT pg_stat_get_backend_idset() AS backendid) AS s;

    select * from (SELECT pg_stat_get_backend_pid(s.backendid) AS procpid, pg_stat_get_backend_activity(s.backendid) AS current_query FROM (SELECT pg_stat_get_backend_idset() AS backendid) AS s) as querystring;

    http://www.pgsqldb.org/pgsqldoc-cvs/monitoring-stats.html
    http://www.pgsqldb.org/pgsqldoc-cvs/monitoring.html

  • 相关阅读:
    禁止input输入框输入指定内容
    js鼠标按键事件和键盘按键事件用法实例汇总
    JSONP实现跨域
    DedeCMS学习
    原生JS实现瀑布流
    常见浏览器兼容问题、盒模型2种模式以及css hack知识讲解
    Ajax学习整理
    Python学习【第三篇】Python变量
    Python学习【第二篇】Python入门
    Python学习【第一篇】Python简介
  • 原文地址:https://www.cnblogs.com/kungfupanda/p/2453361.html
Copyright © 2011-2022 走看看