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

  • 相关阅读:
    linq to access 简单实现 实例demo
    FCKEDITOR中文使用说明 js调用
    asp.net mvc 随想
    fccms 小型简单个人blog源码
    PHP文件上传路径
    前端优化技巧(一)
    会话框拖拽效果实现
    phpmailer配置
    上传图片动态预览(兼容主流浏览器)
    Java将多个list对象根据属性分组后合并成一个新的集合
  • 原文地址:https://www.cnblogs.com/kungfupanda/p/2453361.html
Copyright © 2011-2022 走看看