{
  "annotations":{
    "list":[
      {"builtIn":1,"datasource":{"type":"datasource","uid":"grafana"},"enable":true,"hide":true,"iconColor":"rgba(0, 211, 255, 1)","name":"Annotations & Alerts","target":{"limit":100,"matchAny":false,"tags":[],"type":"dashboard"},"type":"dashboard"},
      {"datasource":{"type":"prometheus","uid":"ds-prometheus"},"enable":false,"expr":"increase(pg_table_autovacuum_count{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","hide":false,"iconColor":"red","name":"Vacuum","step":"1m","titleFormat":"Vacuum"}
    ]
  },
  "author":"Ruohang Feng (rh@vonng.com)",
  "description":"PostgreSQL Single Table Dashboard",
  "editable":true,
  "fiscalYearStartMonth":0,
  "graphTooltip":0,
  "id":null,
  "license":"https://pigsty.io/docs/about/license/",
  "links":[
    { "asDropdown":true,"icon":"external link","includeVars":true,"keepTime":true,"tags":["Pigsty","PGSQL","Overview"],"targetBlank":false,"title":"Overview","tooltip":"","type":"dashboards","url":"" },{ "asDropdown":true,"icon":"external link","includeVars":true,"keepTime":true,"tags":["Pigsty","PGSQL","Cluster"] ,"targetBlank":false,"title":"Cluster" ,"tooltip":"","type":"dashboards","url":"" },
    { "asDropdown":true,"icon":"external link","includeVars":true,"keepTime":true,"tags":["Pigsty","PGSQL","Instance"],"targetBlank":false,"title":"Instance","tooltip":"","type":"dashboards","url":"" },{ "asDropdown":true,"icon":"external link","includeVars":true,"keepTime":true,"tags":["Pigsty","PGSQL","Database"],"targetBlank":false,"title":"Database","tooltip":"","type":"dashboards","url":"" }
  ],
  "panels":[
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":0},"id":62,"panels":[],"title":"Overview","type":"row"},
    {
      "datasource":{"type":"marcusolsson-static-datasource","uid":"ds-static"},
      "description":"",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"mappings":[],"max":2.5,"min":0,"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"}]}},
        "overrides":[
          { "matcher":{"id":"byFrameRefID","options":"A"},"properties":[{"id":"links","value":[{"title":"PGSQL Instance : ${ins}","url":"/d/pgsql-instance?var-ins=${ins}&${__url_time_range}"}]}]                                 },
          { "matcher":{"id":"byFrameRefID","options":"B"},"properties":[{"id":"links","value":[{"title":"PGSQL Databases : ${cls}","url":"/d/pgsql-databases?var-cls=${cls}&var-datname=${datname}&${__url_time_range}"}]}]        },
          { "matcher":{"id":"byFrameRefID","options":"C"},"properties":[{"id":"links","value":[{"title":"PGSQL Database : ${ins}.${datname}","url":"/d/pgsql-database?var-ins=$ins&var-datname=$datname&${__url_time_range}"}]}]   },
          { "matcher":{"id":"byFrameRefID","options":"D"},"properties":[{"id":"links","value":[{"title":"PGCAT Table : ${tblname}","url":"/d/pgcat-table?var-dsn=${ins}.${datname}&var-relname=${relname}&${__url_time_range}"}]}] }
        ]
      },
      "gridPos":{"h":6,"w":6,"x":0,"y":1},
      "id":88,
      "options":{"colorMode":"background","graphMode":"area","justifyMode":"auto","orientation":"horizontal","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"/.*/","values":true},"showPercentChange":false,"text":{"titleSize":16,"valueSize":16},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"12.0.0",
      "targets":[
        { "datasource":{"type":"marcusolsson-static-datasource","uid":"ds-static"},"frame":{"fields":[{"config":{},"name":"Relation","type":"string","values":["${relname}"]}],"meta":{},"name":""},"hide":false,"refId":"D" },
        { "datasource":{"type":"marcusolsson-static-datasource","uid":"ds-static"},"frame":{"fields":[{"config":{},"name":"Database","type":"string","values":["${datname}"]}],"meta":{},"name":""},"hide":false,"refId":"C" },
        { "datasource":{"type":"marcusolsson-static-datasource","uid":"ds-static"},"frame":{"fields":[{"config":{},"name":"Instance","type":"string","values":["$ins"]}],"meta":{},"name":""}      ,"hide":false,"refId":"A" },
        { "datasource":{"type":"marcusolsson-static-datasource","uid":"ds-static"},"frame":{"fields":[{"config":{},"name":"Cluster","type":"string","values":["${cls}"]}],"meta":{},"name":""}     ,"hide":false,"refId":"B" }
      ],
      "title":"",
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"All instances among pgsql cluster ${cls}\n\nInstance: Goto PGSQL Instance\n\nIP: Goto PGSQL Node\n\nStatus: Goto PGSQL Service\n\nLoad: max(cpu,postgres,pgbouncer)\n\nSpace: Disk space usage max(all device)\n\nProxy: session number, Goto Haproxy Admin Page",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"type":"auto"},"inspect":false},"mappings":[],"max":1.2,"min":0,"thresholds":{"mode":"absolute","steps":[{"color":"#e3e3e3e0"}]}},
        "overrides":[
          {"matcher":{"id":"byName","options":"Instance"},"properties":[{"id":"links","value":[{"title":"PGSQL Table : ${__data.fields.Instance}.${datname}.${relname}","url":"/d/pgsql-table?var-ins=${__data.fields.Instance}&var-datname=${datname}&var-relname=${relname}&${__url_time_range}"}]},{"id":"custom.width"}]},
          {"matcher":{"id":"byName","options":"IP"},"properties":[{"id":"custom.width","value":110},{"id":"links","value":[{"title":"Node Instance : ${__data.fields.IP}","url":"/d/node-instance?var-id=${__data.fields.IP}&${__url_time_range}"}]}]},
          {
            "matcher":{"id":"byName","options":"Role"},
            "properties":[
              { "id":"custom.width"      ,"value":80                                                                                                                                             },{ "id":"mappings"          ,"value":[{"options":{"0":{"color":"#3e668f","index":0,"text":"primary"},"1":{"color":"#346f36cc","index":1,"text":"replica"}},"type":"value"}]         },
              { "id":"custom.cellOptions","value":{"mode":"gradient","type":"color-background"}                                                                                                  },{ "id":"links"             ,"value":[{"title":"PGSQL Service for ${cls}-${__data.fields.Role}","url":"/d/pgsql-service?var-svc=${cls}-${__data.fields.Role}&${__url_time_range}"}] }
            ]
          },{
            "matcher":{"id":"byName","options":"Load"},
            "properties":[
              { "id":"custom.cellOptions","value":{"mode":"gradient","type":"gauge"}                                                                                                                                                                                                         },
              { "id":"color"             ,"value":{"mode":"thresholds"}                                                                                                                                                                                                                      },
              { "id":"unit"              ,"value":"percentunit"                                                                                                                                                                                                                              },
              { "id":"custom.width"      ,"value":120                                                                                                                                                                                                                                        },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":0.1},{"color":"#fcdb72","value":0.3},{"color":"#f79f64","value":0.5},{"color":"red","value":0.7},{"color":"#b783af","value":0.9},{"color":"text","value":1}]} },
              { "id":"decimals"          ,"value":1                                                                                                                                                                                                                                          },
              { "id":"mappings"          ,"value":[{"options":{"-1":{"color":"transparent","index":0,"text":"N/A"}},"type":"value"}]                                                                                                                                                         }
            ]
          },
          {"matcher":{"id":"byName","options":"Cluster"},"properties":[{"id":"links","value":[{"title":"PGSQL Cluster for ${__data.fields.Cluster}","url":"/d/pgsql-cluster?var-cls=${__data.fields.Cluster}&${__url_time_range}"}]}]},
          {"matcher":{"id":"byName","options":"TPS"},"properties":[{"id":"custom.width","value":80},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#3e668f","value":32},{"color":"#f79f64","value":32000}]}},{"id":"custom.cellOptions","value":{"type":"color-text"}}]},
          {"matcher":{"id":"byName","options":"QPS"},"properties":[{"id":"custom.width","value":80},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#3e668f","value":32},{"color":"#f79f64","value":32000}]}},{"id":"custom.cellOptions","value":{"type":"color-text"}}]},
          {
            "matcher":{"id":"byName","options":"Conn"},
            "properties":[{"id":"custom.width","value":80},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":4},{"color":"#EAB839","value":20},{"color":"#EF843C","value":40},{"color":"#E24D42","value":80},{"color":"#b783af","value":100},{"color":"text","value":400}]}},{"id":"custom.cellOptions","value":{"type":"color-text"}}]
          },{
            "matcher":{"id":"byName","options":"RT"},
            "properties":[
              { "id":"custom.width"      ,"value":80                                                                                                                                                                                                  },
              { "id":"unit"              ,"value":"s"                                                                                                                                                                                                 },
              { "id":"mappings"          ,"value":[{"options":{"match":"nan","result":{"index":1,"text":"-"}},"type":"special"}]                                                                                                                      },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"#fcdb72","value":1},{"color":"#f79f64","value":2},{"color":"red","value":4},{"color":"#b783af","value":8},{"color":"text","value":16}]} },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                               }
            ]
          },
          {"matcher":{"id":"byName","options":"Queue"},"properties":[{"id":"custom.width","value":60},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"red","value":1}]}},{"id":"custom.cellOptions","value":{"type":"color-text"}}]},
          {"matcher":{"id":"byName","options":"HAProxy"},"properties":[{"id":"links","value":[{"targetBlank":true,"title":"HAProxy Admin Page : ${__data.fields.Instance}","url":"/haproxy/${__data.fields.Instance}"}]}]},
          {"matcher":{"id":"byName","options":"Up"},"properties":[{"id":"custom.width","value":80},{"id":"mappings","value":[{"options":{"0":{"color":"#cc4637d9","index":0,"text":"Dead"},"1":{"color":"#346f36cc","index":1,"text":"Alive"}},"type":"value"}]},{"id":"custom.cellOptions","value":{"type":"color-background"}}]}
        ]
      },
      "gridPos":{"h":6,"w":8,"x":6,"y":1},
      "id":87,
      "links":[{"title":"PGSQL Instance : ${primary}","url":"/d/pgsql-instance?var-ins=${primary}&${__url_time_range}"}],
      "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[{"desc":false,"displayName":"Instance"}]},
      "pluginVersion":"12.0.0",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"min by (ins,ip) (up{job=\"pgsql\", cls=\"$cls\"})"                                       ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (ins) (pg:ins:load1{cls=\"$cls\"})"                                               ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"sum by (ins) (pg:ins:xact_total_rate1m{cls=\"$cls\"})"                                   ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"C" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"min by (ins,ip) (pg_in_recovery{cls=\"$cls\"})"                                          ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"D" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"max by (ins) (pg:ins:num_backends{cls=\"$cls\"})"                                        ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"E" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"max by (ins) (pgbouncer:ins:xact_rt_1m{cls=\"$cls\"})"                                   ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"F" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"sum by (ins,instance) (haproxy_backend_current_sessions{cls=\"$cls\", proxy!=\"stats\"})","format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"G" }
      ],
      "title":"",
      "transformations":[
        {"id":"seriesToColumns","options":{"byField":"ins"}},
        {
          "id":"organize",
          "options":{
            "excludeByName":{
              "Time":true,
              "Time 1":true,
              "Time 10":true,
              "Time 2":true,
              "Time 3":true,
              "Time 4":true,
              "Time 6":true,
              "Time 8":true,
              "Time 9":true,
              "Value #A":false,
              "Value #B":false,
              "Value #C":false,
              "Value #E":false,
              "Value #F":true,
              "Value #G":true,
              "Value #H":false,
              "__name__":true,
              "__name__ 1":true,
              "__name__ 2":true,
              "__name__ 3":true,
              "__name__ 5":true,
              "__name__ 7":true,
              "cls":true,
              "cls 1":true,
              "cls 2":true,
              "cls 3":true,
              "cls 4":true,
              "cls 5":true,
              "cls 6":true,
              "cls 7":true,
              "instance":true,
              "instance 1":true,
              "instance 2":false,
              "instance 3":true,
              "instance 4":true,
              "instance 5":true,
              "instance 6":true,
              "ip 2":true,
              "ip 3":true,
              "ip 4":true,
              "ip 5":true,
              "ip 6":true,
              "ip 7":true,
              "job":true,
              "job 1":true,
              "job 2":true,
              "job 3":true,
              "job 4":true,
              "job 5":true,
              "job 6":true,
              "job 7":true
            },
            "indexByName":{"Time 1":8,"Time 2":9,"Time 3":10,"Time 4":11,"Time 5":12,"Time 6":14,"Value #A":0,"Value #B":4,"Value #C":5,"Value #D":1,"Value #E":6,"Value #F":7,"ins":2,"ip 1":3,"ip 2":13},
            "renameByName":{"Time 4":"","Value #A":"Up","Value #B":"Load","Value #C":"TPS","Value #D":"Role","Value #E":"Conn","Value #F":"RT","Value #G":"LB Conn","Value #H":"LB","Value #I":"QPS","Value #J":"LB Clients","Value #K":"Lag","cls 1":"","cls 2":"","ins":"Instance","instance":"HAProxy","instance 2":"","ip":"IP","ip 1":"IP"}
          }
        }
      ],
      "type":"table"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"auto","cellOptions":{"type":"auto"},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"#EAB839","value":0}]}},
        "overrides":[
          {"matcher":{"id":"byName","options":"Table"},"properties":[{"id":"links","value":[{"title":"${__data.fields.Table}","url":"/d/pgsql-table?var-ins=${ins}&var-cls=${cls}&var-datname=${datname}&var-relname=${__data.fields.Table}&${__url_time_range}"}]}]},
          {
            "matcher":{"id":"byName","options":"Scan"},
            "properties":[
              { "id":"custom.width"      ,"value":80                                                                                                                                                                                                       },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"super-light-green","value":1},{"color":"light-green","value":10},{"color":"semi-dark-green","value":100},{"color":"dark-green","value":1000}]} },
              { "id":"color"             ,"value":{"mode":"thresholds"}                                                                                                                                                                                    },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                                    },
              { "id":"mappings"          ,"value":[{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"N/A"}},"type":"special"}]                                                                                                     }
            ]
          },{
            "matcher":{"id":"byName","options":"Rows"},
            "properties":[
              { "id":"custom.width"      ,"value":100                                                                                                                                                                                                                                                                                                     },
              { "id":"unit"              ,"value":"short"                                                                                                                                                                                                                                                                                                 },
              { "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":1000},{"color":"super-light-green","value":1000000000},{"color":"#fcdb72","value":10000000000},{"color":"#f79f64","value":100000000000},{"color":"red","value":1000000000000},{"color":"#EAB839","value":10000000000000}]} },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                                                                                                                                                                   },
              { "id":"mappings"          ,"value":[{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"N/A"}},"type":"special"}]                                                                                                                                                                                                    }
            ]
          },{
            "matcher":{"id":"byName","options":"Size"},
            "properties":[
              {"id":"custom.width","value":100},{"id":"unit","value":"decbytes"},{"id":"decimals","value":1},{"id":"custom.cellOptions","value":{"type":"color-text"}},
              {"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"super-light-blue","value":8192},{"color":"super-light-green","value":8193},{"color":"#346f36cc","value":1000000},{"color":"#fcdb72","value":1000000000},{"color":"#f79f64","value":10000000000},{"color":"red","value":10000000000},{"color":"#b783af","value":30000000000},{"color":"text","value":100000000000}]}}
            ]
          }
        ]
      },
      "gridPos":{"h":6,"w":10,"x":14,"y":1},
      "id":85,
      "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[{"desc":true,"displayName":"Rows"}]},
      "pluginVersion":"12.0.0",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"sum by (relname) (pg:table:scan_rate1m{ins=\"$ins\", datname=\"$datname\"})","format":"table",             "instant":true,"interval":"","legendFormat":"","refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"sum by (relname) (pg_table_n_live_tup{ins=\"$ins\", datname=\"$datname\"})" ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"sum by (relname) (pg_table_size_bytes{ins=\"$ins\", datname=\"$datname\"})" ,"format":"table","hide":false,"instant":true,"interval":"","legendFormat":"","refId":"C" }
      ],
      "title":"",
      "transformations":[
        { "id":"seriesToColumns","options":{"byField":"relname"}                                                                                                                                                                                                                                                                                                                      },
        { "id":"organize"       ,"options":{"excludeByName":{"Time":true,"Time 1":true,"Time 2":true,"Time 3":true,"__name__":true,"cls":true,"datname":true,"ins":true},"indexByName":{"Time 1":4,"Time 2":5,"Time 3":6,"Value #A":1,"Value #B":2,"Value #C":3,"relname":0},"renameByName":{"Value":"Scan","Value #A":"Scan","Value #B":"Rows","Value #C":"Size","relname":"Table"}} }
      ],
      "type":"table"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]}},
        "overrides":[{"matcher":{"id":"byName","options":"Size"},"properties":[{"id":"unit","value":"bytes"}]},{"matcher":{"id":"byName","options":"OID"},"properties":[{"id":"unit","value":"none"}]},{"matcher":{"id":"byName","options":"Row W/R %"},"properties":[{"id":"unit","value":"percentunit"}]}]
      },
      "gridPos":{"h":5,"w":12,"x":0,"y":7},
      "id":60,
      "options":{"colorMode":"background","graphMode":"none","justifyMode":"auto","orientation":"auto","percentChangeColorMode":"standard","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":16},"textMode":"auto","wideLayout":true},
      "pluginVersion":"12.0.0",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg_table_relid{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}"                                                                                         ,                "hide":false,"interval":"","legendFormat":"OID"      ,"refId":"J","range":true },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"pg_table_ncols{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}"                                                                                         ,"instant":false,             "interval":"","legendFormat":"Columns"  ,"refId":"A"              },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"pg_table_tuples{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}"                                                                                        ,                "hide":false,"interval":"","legendFormat":"Rows"     ,"refId":"B"              },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"pg_table_size_bytes{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}"                                                                                    ,                "hide":false,"interval":"","legendFormat":"Size"     ,"refId":"C"              },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"pg_table_age{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}"                                                                                           ,                "hide":false,"interval":"","legendFormat":"Age"      ,"refId":"D"              },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"rate(pg_table_tup_read{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])"                                                                            ,                "hide":false,"interval":"","legendFormat":"Row Read" ,"refId":"E","range":true },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"rate(pg_table_n_tup_mod{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])"                                                                           ,                "hide":false,"interval":"","legendFormat":"Row Mod"  ,"refId":"F","range":true },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"pg_table_n_tup_mod{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}\n/( 1 + pg_table_tup_read{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"})",                "hide":false,"interval":"","legendFormat":"Row W/R %","refId":"K","range":true },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"pg:table:scan{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}"                                                                                          ,                "hide":false,"interval":"","legendFormat":"Scan"     ,"refId":"G"              },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"rate(pg_table_seq_scan{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[5m])"                                                                            ,                "hide":false,"interval":"","legendFormat":"Seq Scan" ,"refId":"H"              },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},                    "exemplar":false,"expr":"rate(pg_table_idx_scan{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[5m])"                                                                            ,                "hide":false,"interval":"","legendFormat":"Idx Scan" ,"refId":"I"              }
      ],
      "title":"",
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":50,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":0,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"normal"},
            "thresholdsStyle":{"mode":"off"}
          },
          "links":[{"title":"PGSQL TABLE for ${__field.labels.relname}","url":"/d/pgsql-table?var-ins=${ins}&var-cls=${cls}&var-datname=${__field.labels.datname}&var-relname=${__field.labels.relname}&${__url_time_range}"}],
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"qps"
        },
        "overrides":[]
      },
      "gridPos":{"h":5,"w":12,"x":12,"y":7},
      "id":83,
      "options":{"legend":{"calcs":["max"],"displayMode":"list","placement":"bottom","showLegend":false},"tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},
      "pluginVersion":"12.0.0",
      "targets":[{"exemplar":false,"expr":"pg:table:scan_rate1m{ins=\"$ins\", datname=\"$datname\"}","interval":"","intervalFactor":2,"legendFormat":"{{ relname }}","refId":"B"}],
      "title":"Table Scan",
      "type":"timeseries"
    },
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":12},"id":7,"panels":[],"title":"Scan & Access","type":"row"},
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Total scan (index + seq) rate of last 1 minute on this table",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":82,
            "gradientMode":"hue",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":0,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"normal"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short"
        },
        "overrides":[
          { "matcher":{"id":"byName","options":"Index"}     ,"properties":[{"id":"custom.lineWidth","value":0},{"id":"custom.lineInterpolation","value":"smooth"},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}] },
          { "matcher":{"id":"byName","options":"Sequential"},"properties":[{"id":"custom.lineInterpolation","value":"linear"},{"id":"custom.lineWidth","value":1},{"id":"color","value":{"fixedColor":"#f79f64","mode":"fixed"}}] }
        ]
      },
      "gridPos":{"h":7,"w":12,"x":0,"y":13},
      "id":4,
      "options":{"legend":{"calcs":[],"displayMode":"list","placement":"bottom","showLegend":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_table_idx_scan{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","interval":"","legendFormat":"Index","refId":"A"},{"exemplar":false,"expr":"rate(pg_table_seq_scan{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","hide":false,"interval":"","legendFormat":"Sequential","refId":"B"}],
      "title":"Table Scan Rate",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Total scan (index + seq) rate of last 1 minute on this table",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":80,
            "gradientMode":"hue",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":0,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"normal"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short"
        },
        "overrides":[{"matcher":{"id":"byName","options":"Index"},"properties":[{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]},{"matcher":{"id":"byName","options":"Sequential"},"properties":[{"id":"color","value":{"fixedColor":"#f79f64","mode":"fixed"}}]}]
      },
      "gridPos":{"h":7,"w":12,"x":12,"y":13},
      "id":5,
      "options":{"legend":{"calcs":[],"displayMode":"list","placement":"bottom","showLegend":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_table_idx_tup_fetch{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","interval":"","legendFormat":"Index","refId":"A"},{"exemplar":false,"expr":"rate(pg_table_seq_tup_read{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","hide":false,"interval":"","legendFormat":"Sequential","refId":"B"}],
      "title":"Row Scan Rate",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Index scan rate of last 1 minute on this table",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":44,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short"
        },
        "overrides":[
          { "matcher":{"id":"byName","options":"rate5m"},"properties":[{"id":"custom.lineWidth","value":0},{"id":"custom.lineInterpolation","value":"smooth"},{"id":"custom.fillOpacity","value":54},{"id":"color","value":{"fixedColor":"#346f36cc","mode":"fixed"}}] },
          { "matcher":{"id":"byName","options":"rate1m"},"properties":[{"id":"custom.fillOpacity","value":0},{"id":"custom.lineInterpolation","value":"linear"},{"id":"custom.lineWidth","value":2},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]    }
        ]
      },
      "gridPos":{"h":7,"w":12,"x":0,"y":20},
      "id":2,
      "options":{"legend":{"calcs":[],"displayMode":"list","placement":"bottom","showLegend":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_table_idx_scan{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","interval":"","legendFormat":"rate1m","refId":"A"},{"exemplar":false,"expr":"rate(pg_table_idx_scan{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[5m])","hide":false,"interval":"","legendFormat":"rate5m","refId":"B"}],
      "title":"Index Scan Rate",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Sequential scan rate of last 1 minute on this table",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":44,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short"
        },
        "overrides":[
          { "matcher":{"id":"byName","options":"rate5m"},"properties":[{"id":"custom.lineWidth","value":0},{"id":"custom.lineInterpolation","value":"smooth"},{"id":"custom.fillOpacity","value":54},{"id":"color","value":{"fixedColor":"#346f36cc","mode":"fixed"}}] },
          { "matcher":{"id":"byName","options":"rate1m"},"properties":[{"id":"custom.fillOpacity","value":0},{"id":"custom.lineInterpolation","value":"linear"},{"id":"custom.lineWidth","value":2},{"id":"color","value":{"fixedColor":"#f79f64","mode":"fixed"}}]    }
        ]
      },
      "gridPos":{"h":7,"w":12,"x":12,"y":20},
      "id":49,
      "options":{"legend":{"calcs":[],"displayMode":"list","placement":"bottom","showLegend":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_table_seq_scan{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","interval":"","legendFormat":"rate1m","refId":"A"},{"exemplar":false,"expr":"rate(pg_table_seq_scan{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[5m])","hide":false,"interval":"","legendFormat":"rate5m","refId":"B"}],
      "title":"Sequential Scan Rate",
      "type":"timeseries"
    },
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":27},"id":21,"panels":[],"title":"Modification","type":"row"},
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Tuple Modification (insert|delete|update) in last 5 minutes",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":70,
            "gradientMode":"hue",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":0,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"normal"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short"
        },
        "overrides":[{"matcher":{"id":"byName","options":"INSERT"},"properties":[{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]},{"matcher":{"id":"byName","options":"DELETE"},"properties":[{"id":"color","value":{"fixedColor":"#cc4637d9","mode":"fixed"}}]},{"matcher":{"id":"byName","options":"UPDATE"},"properties":[{"id":"color","value":{"fixedColor":"#b783af","mode":"fixed"}}]}]
      },
      "gridPos":{"h":7,"w":12,"x":0,"y":28},
      "id":43,
      "options":{"legend":{"calcs":[],"displayMode":"list","placement":"bottom","showLegend":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.0.0",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"increase(pg_table_n_tup_ins{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[5m])",             "interval":"","legendFormat":"INSERT","refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"increase(pg_table_n_tup_del{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[5m])","hide":false,"interval":"","legendFormat":"DELETE","refId":"B" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"increase(pg_table_n_tup_upd{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[5m])","hide":false,"interval":"","legendFormat":"UPDATE","refId":"C" }
      ],
      "title":"Rows Modified (5m)",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Tuple insert rate of last 1 minute & 5 minute",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":40,
            "gradientMode":"hue",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":0,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short"
        },
        "overrides":[
          { "matcher":{"id":"byName","options":"rate5m"},"properties":[{"id":"custom.lineWidth","value":0},{"id":"custom.lineInterpolation","value":"smooth"},{"id":"color","value":{"fixedColor":"#346f36cc","mode":"fixed"}}]                                     },
          { "matcher":{"id":"byName","options":"rate1m"},"properties":[{"id":"custom.lineInterpolation","value":"linear"},{"id":"custom.lineWidth","value":1},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}},{"id":"custom.fillOpacity","value":0}] }
        ]
      },
      "gridPos":{"h":7,"w":12,"x":12,"y":28},
      "id":40,
      "options":{"legend":{"calcs":[],"displayMode":"list","placement":"bottom","showLegend":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_table_n_tup_ins{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","interval":"","legendFormat":"rate1m","refId":"A"},{"exemplar":false,"expr":"rate(pg_table_n_tup_ins{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[5m])","hide":false,"interval":"","legendFormat":"rate5m","refId":"B"}],
      "title":"Inserts",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Tuple insert rate of last 1 minute & 5 minute",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":40,
            "gradientMode":"hue",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":0,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short"
        },
        "overrides":[
          { "matcher":{"id":"byName","options":"rate5m"},"properties":[{"id":"custom.lineWidth","value":0},{"id":"custom.lineInterpolation","value":"smooth"},{"id":"custom.fillOpacity","value":54},{"id":"color","value":{"fixedColor":"#346f36cc","mode":"fixed"}}] },
          { "matcher":{"id":"byName","options":"rate1m"},"properties":[{"id":"custom.fillOpacity","value":0},{"id":"custom.lineInterpolation","value":"linear"},{"id":"custom.lineWidth","value":1},{"id":"color","value":{"fixedColor":"#b783af","mode":"fixed"}}]    }
        ]
      },
      "gridPos":{"h":7,"w":12,"x":0,"y":35},
      "id":42,
      "options":{"legend":{"calcs":[],"displayMode":"list","placement":"bottom","showLegend":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_table_n_tup_upd{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","interval":"","legendFormat":"rate1m","refId":"A"},{"exemplar":false,"expr":"rate(pg_table_n_tup_upd{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[5m])","hide":false,"interval":"","legendFormat":"rate5m","refId":"B"}],
      "title":"Updates",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Tuple insert rate of last 1 minute & 5 minute",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":40,
            "gradientMode":"hue",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":0,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":true,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short"
        },
        "overrides":[
          { "matcher":{"id":"byName","options":"rate5m"},"properties":[{"id":"custom.lineWidth","value":0},{"id":"custom.lineInterpolation","value":"smooth"},{"id":"custom.fillOpacity","value":54},{"id":"color","value":{"fixedColor":"#346f36cc","mode":"fixed"}}] },
          { "matcher":{"id":"byName","options":"rate1m"},"properties":[{"id":"custom.fillOpacity","value":0},{"id":"custom.lineInterpolation","value":"linear"},{"id":"custom.lineWidth","value":1},{"id":"color","value":{"fixedColor":"#cc4637d9","mode":"fixed"}}]  }
        ]
      },
      "gridPos":{"h":7,"w":12,"x":12,"y":35},
      "id":41,
      "options":{"legend":{"calcs":[],"displayMode":"list","placement":"bottom","showLegend":true},"tooltip":{"hideZeros":false,"mode":"multi","sort":"none"}},
      "pluginVersion":"12.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_table_n_tup_del{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","interval":"","legendFormat":"rate1m","refId":"A"},{"exemplar":false,"expr":"rate(pg_table_n_tup_del{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[5m])","hide":false,"interval":"","legendFormat":"rate5m","refId":"B"}],
      "title":"Deletes",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Rate1m of rows HOT updated",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"bars",
            "fillOpacity":44,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":0,
            "pointSize":2,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":true,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"none",
          "unitScale":true
        },
        "overrides":[
          { "matcher":{"id":"byName","options":"rate5m"},"properties":[{"id":"custom.lineWidth","value":0},{"id":"custom.lineInterpolation","value":"smooth"},{"id":"custom.fillOpacity","value":54},{"id":"color","value":{"fixedColor":"#346f36cc","mode":"fixed"}}] },
          { "matcher":{"id":"byName","options":"rate1m"},"properties":[{"id":"custom.fillOpacity","value":0},{"id":"custom.lineInterpolation","value":"linear"},{"id":"custom.lineWidth","value":1},{"id":"color","value":{"fixedColor":"#b783af","mode":"fixed"}}]    }
        ]
      },
      "gridPos":{"h":5,"w":12,"x":0,"y":42},
      "id":67,
      "options":{"legend":{"calcs":[],"displayMode":"list","placement":"bottom","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.1",
      "targets":[{"exemplar":false,"expr":"rate(pg_table_n_tup_hot_upd{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","interval":"","legendFormat":"rate1m","refId":"A"},{"exemplar":false,"expr":"rate(pg_table_n_tup_hot_upd{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[5m])","hide":false,"interval":"","legendFormat":"rate5m","refId":"B"}],
      "title":"HOT Updates",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Rate1m of rows HOT updated",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"points",
            "fillOpacity":44,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":0,
            "pointSize":4,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"always",
            "spanNulls":true,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "max":1,
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"percentunit",
          "unitScale":true
        },
        "overrides":[
          { "matcher":{"id":"byName","options":"rate5m"},"properties":[{"id":"custom.lineWidth","value":0},{"id":"custom.lineInterpolation","value":"smooth"},{"id":"custom.fillOpacity","value":54},{"id":"color","value":{"fixedColor":"#346f36cc","mode":"fixed"}}] },
          { "matcher":{"id":"byName","options":"rate1m"},"properties":[{"id":"custom.fillOpacity","value":0},{"id":"custom.lineInterpolation","value":"linear"},{"id":"custom.lineWidth","value":1},{"id":"color","value":{"fixedColor":"#b783af","mode":"fixed"}}]    }
        ]
      },
      "gridPos":{"h":5,"w":12,"x":12,"y":42},
      "id":68,
      "options":{"legend":{"calcs":[],"displayMode":"list","placement":"bottom","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.1",
      "targets":[{"exemplar":false,"expr":"increase(pg_table_n_tup_hot_upd{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]) / increase(pg_table_n_tup_upd{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","interval":"","legendFormat":"HOT Rate","refId":"A"}],
      "title":"HOT Rate",
      "type":"timeseries"
    },
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":47},"id":9,"panels":[],"title":"Indexes","type":"row"},
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Index scan rate of last 1 minute on this table",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":44,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short",
          "unitScale":true
        },
        "overrides":[{"matcher":{"id":"byName","options":"rate1m"},"properties":[{"id":"custom.fillOpacity","value":0},{"id":"custom.lineInterpolation","value":"linear"},{"id":"custom.lineWidth","value":2},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]}]
      },
      "gridPos":{"h":10,"w":12,"x":0,"y":48},
      "id":12,
      "options":{"legend":{"calcs":["mean","max"],"displayMode":"table","placement":"bottom","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"rate(pg_index_idx_scan{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","interval":"","legendFormat":"{{ idxname }}","refId":"A"}],
      "title":"Index Scan Rate",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Rate1m of rows HOT updated",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"points",
            "fillOpacity":44,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":0,
            "pointSize":2,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"always",
            "spanNulls":true,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "max":1,
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"percentunit",
          "unitScale":true
        },
        "overrides":[
          { "matcher":{"id":"byName","options":"rate5m"},"properties":[{"id":"custom.lineWidth","value":0},{"id":"custom.lineInterpolation","value":"smooth"},{"id":"custom.fillOpacity","value":54},{"id":"color","value":{"fixedColor":"#346f36cc","mode":"fixed"}}] },
          { "matcher":{"id":"byName","options":"rate1m"},"properties":[{"id":"custom.fillOpacity","value":0},{"id":"custom.lineInterpolation","value":"linear"},{"id":"custom.lineWidth","value":1},{"id":"color","value":{"fixedColor":"#b783af","mode":"fixed"}}]    }
        ]
      },
      "gridPos":{"h":10,"w":12,"x":12,"y":48},
      "id":70,
      "options":{"legend":{"calcs":["min"],"displayMode":"table","placement":"bottom","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.1",
      "targets":[{"exemplar":false,"expr":"rate(pg_index_idx_blks_hit{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]) / (rate(pg_index_idx_blks_read{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]) + rate(pg_index_idx_blks_hit{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]))","interval":"","legendFormat":"{{ idxname }}","refId":"A"}],
      "title":"Index Block Hit Rate",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Rate of index tuples been read",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":44,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short",
          "unitScale":true
        },
        "overrides":[{"matcher":{"id":"byName","options":"rate1m"},"properties":[{"id":"custom.fillOpacity","value":0},{"id":"custom.lineInterpolation","value":"linear"},{"id":"custom.lineWidth","value":2},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]},{"matcher":{"id":"byName","options":"public.binary_version_pkey"},"properties":[{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]}]
      },
      "gridPos":{"h":10,"w":12,"x":0,"y":58},
      "id":13,
      "options":{"legend":{"calcs":["mean","max"],"displayMode":"table","placement":"bottom","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.1",
      "targets":[{"exemplar":false,"expr":"rate(pg_index_idx_tup_read{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","interval":"","legendFormat":"{{ idxname }}","refId":"A"}],
      "title":"Index Tuple Returned",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Rate of live table rows fetched by simple index scans using this index",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":44,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short",
          "unitScale":true
        },
        "overrides":[{"matcher":{"id":"byName","options":"rate1m"},"properties":[{"id":"custom.fillOpacity","value":0},{"id":"custom.lineInterpolation","value":"linear"},{"id":"custom.lineWidth","value":2},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]},{"matcher":{"id":"byName","options":"public.binary_version_pkey"},"properties":[{"id":"color","value":{"fixedColor":"#f79f64","mode":"fixed"}}]}]
      },
      "gridPos":{"h":10,"w":12,"x":12,"y":58},
      "id":45,
      "options":{"legend":{"calcs":["mean","max"],"displayMode":"table","placement":"bottom","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.1",
      "targets":[{"exemplar":false,"expr":"rate(pg_index_idx_tup_fetch{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","interval":"","legendFormat":"{{ idxname }}","refId":"A"}],
      "title":"Index Tuple Fetched",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":50,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":1,
            "pointSize":1,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"always",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short",
          "unitScale":true
        },
        "overrides":[{"matcher":{"id":"byName","options":"rate1m"},"properties":[{"id":"custom.fillOpacity","value":0},{"id":"custom.lineInterpolation","value":"linear"},{"id":"custom.lineWidth","value":2},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]},{"matcher":{"id":"byName","options":"public.binary_version_pkey"},"properties":[{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]}]
      },
      "gridPos":{"h":10,"w":12,"x":0,"y":68},
      "id":50,
      "options":{"legend":{"calcs":["mean","max"],"displayMode":"table","placement":"bottom","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.1",
      "targets":[{"exemplar":false,"expr":"increase(pg_index_idx_tup_read{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]) / increase(pg_index_idx_scan{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","interval":"","legendFormat":"{{ idxname }}","refId":"A"}],
      "title":"Tuple Returned Per Scan",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":50,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":1,
            "pointSize":1,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"always",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short",
          "unitScale":true
        },
        "overrides":[{"matcher":{"id":"byName","options":"rate1m"},"properties":[{"id":"custom.fillOpacity","value":0},{"id":"custom.lineInterpolation","value":"linear"},{"id":"custom.lineWidth","value":2},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]},{"matcher":{"id":"byName","options":"public.binary_version_pkey"},"properties":[{"id":"color","value":{"fixedColor":"#f79f64","mode":"fixed"}}]}]
      },
      "gridPos":{"h":10,"w":12,"x":12,"y":68},
      "id":72,
      "options":{"legend":{"calcs":["mean","max"],"displayMode":"table","placement":"bottom","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.1",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"increase(pg_index_idx_tup_fetch{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]) / increase(pg_index_idx_scan{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","interval":"","legendFormat":"{{ idxname }}","refId":"A"}],
      "title":"Tuple Fetched Per Scan",
      "type":"timeseries"
    },
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":78},"id":16,"panels":[],"title":"Sequences","type":"row"},
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Total scan (index + seq) rate of last 1 minute on this table",
      "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"mappings":[],"min":0,"thresholds":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":2147483648},{"color":"red","value":4611686018427388000},{"color":"#b783af","value":9223372036854776000}]},"unit":"none","unitScale":true},"overrides":[]},
      "gridPos":{"h":7,"w":7,"x":0,"y":79},
      "id":14,
      "options":{"colorMode":"background","graphMode":"none","justifyMode":"center","orientation":"horizontal","reduceOptions":{"calcs":["lastNotNull"],"fields":"","values":false},"showPercentChange":false,"text":{"titleSize":16,"valueSize":20},"textMode":"value_and_name","wideLayout":true},
      "pluginVersion":"10.3.3",
      "targets":[{"exemplar":false,"expr":"pg_seq_last_value{ins=\"$ins\", datname=\"$datname\", seqname=~\"$relname.*\"}","interval":"","legendFormat":"{{ seqname }}","refId":"A"}],
      "title":"Sequence Values",
      "type":"stat"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Index scan tuples/s of last 1 minute",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":44,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "decimals":0,
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short",
          "unitScale":true
        },
        "overrides":[{"matcher":{"id":"byName","options":"rate1m"},"properties":[{"id":"custom.fillOpacity","value":0},{"id":"custom.lineInterpolation","value":"linear"},{"id":"custom.lineWidth","value":2},{"id":"color","value":{"fixedColor":"#3e668f","mode":"fixed"}}]}]
      },
      "gridPos":{"h":7,"w":17,"x":7,"y":79},
      "id":17,
      "options":{"legend":{"calcs":["mean"],"displayMode":"table","placement":"bottom","showLegend":true},"tooltip":{"mode":"none","sort":"none"}},
      "pluginVersion":"8.0.1",
      "targets":[{"exemplar":false,"expr":"increase(pg_seq_last_value{ins=\"$ins\", datname=\"$datname\", seqname=~\"$relname.*\"}[1m])","interval":"","legendFormat":"{{ seqname }}","refId":"A"}],
      "title":"Sequence Allocation (1m)",
      "type":"timeseries"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":86},
      "id":19,
      "panels":[
        {
          "datasource":{"type":"prometheus","uid":"ds-prometheus"},
          "fieldConfig":{
            "defaults":{
              "color":{"mode":"palette-classic"},
              "custom":{"axisLabel":"","axisPlacement":"auto","barAlignment":0,"drawStyle":"line","fillOpacity":3,"gradientMode":"none","hideFrom":{"legend":false,"tooltip":false,"viz":false},"lineInterpolation":"linear","lineWidth":1,"pointSize":5,"scaleDistribution":{"type":"linear"},"showPoints":"never","spanNulls":false,"stacking":{"group":"A","mode":"none"},"thresholdsStyle":{"mode":"off"}},
              "mappings":[],
              "min":0,
              "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"red","value":80}]},
              "unit":"short"
            },
            "overrides":[]
          },
          "gridPos":{"h":8,"w":12,"x":0,"y":112},
          "id":25,
          "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi"}},
          "pluginVersion":"8.0.0",
          "targets":[{"exemplar":false,"expr":"rate(pg_func_calls{ins=\"$ins\", datname=\"$datname\", funcname=~\".*$relname.*\"}[1m])","interval":"","legendFormat":"{{ funcname }}","refId":"A"}],
          "title":"Function Call",
          "type":"timeseries"
        },{
          "datasource":{"type":"prometheus","uid":"ds-prometheus"},
          "fieldConfig":{
            "defaults":{
              "color":{"mode":"palette-classic"},
              "custom":{"axisLabel":"","axisPlacement":"auto","barAlignment":0,"drawStyle":"line","fillOpacity":44,"gradientMode":"none","hideFrom":{"legend":false,"tooltip":false,"viz":false},"lineInterpolation":"stepBefore","lineWidth":0,"pointSize":5,"scaleDistribution":{"type":"linear"},"showPoints":"never","spanNulls":false,"stacking":{"group":"A","mode":"normal"},"thresholdsStyle":{"mode":"off"}},
              "mappings":[],
              "min":0,
              "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"red","value":80}]},
              "unit":"ms"
            },
            "overrides":[]
          },
          "gridPos":{"h":8,"w":12,"x":12,"y":112},
          "id":29,
          "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi"}},
          "pluginVersion":"8.0.0",
          "targets":[{"exemplar":false,"expr":"rate(pg_func_total_time{ins=\"$ins\", datname=\"$datname\", funcname=~\".*$relname.*\"}[1m]) / rate(pg_func_calls{ins=\"$ins\", datname=\"$datname\", funcname=~\".*$relname.*\"}[1m])","interval":"","legendFormat":"{{ funcname }}","refId":"A"}],
          "title":"Function Time Spend (Stacked)",
          "type":"timeseries"
        },{
          "datasource":{"type":"prometheus","uid":"ds-prometheus"},
          "fieldConfig":{
            "defaults":{
              "color":{"mode":"palette-classic"},
              "custom":{"axisLabel":"","axisPlacement":"auto","barAlignment":0,"drawStyle":"line","fillOpacity":6,"gradientMode":"none","hideFrom":{"legend":false,"tooltip":false,"viz":false},"lineInterpolation":"smooth","lineWidth":1,"pointSize":5,"scaleDistribution":{"type":"linear"},"showPoints":"never","spanNulls":false,"stacking":{"group":"A","mode":"none"},"thresholdsStyle":{"mode":"off"}},
              "mappings":[],
              "min":0,
              "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"red","value":80}]},
              "unit":"ms"
            },
            "overrides":[]
          },
          "gridPos":{"h":8,"w":12,"x":0,"y":120},
          "id":27,
          "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi"}},
          "pluginVersion":"8.0.0",
          "targets":[{"exemplar":false,"expr":"rate(pg_func_self_time{ins=\"$ins\", datname=\"$datname\", funcname=~\".*$relname.*\"}[1m]) / rate(pg_func_calls{ins=\"$ins\", datname=\"$datname\", funcname=~\".*$relname.*\"}[1m])","interval":"","legendFormat":"{{ funcname }}","refId":"A"}],
          "title":"Function Duration (Self Time)",
          "type":"timeseries"
        },{
          "datasource":{"type":"prometheus","uid":"ds-prometheus"},
          "fieldConfig":{
            "defaults":{
              "color":{"mode":"palette-classic"},
              "custom":{"axisLabel":"","axisPlacement":"auto","barAlignment":0,"drawStyle":"line","fillOpacity":1,"gradientMode":"none","hideFrom":{"legend":false,"tooltip":false,"viz":false},"lineInterpolation":"smooth","lineWidth":1,"pointSize":5,"scaleDistribution":{"type":"linear"},"showPoints":"never","spanNulls":false,"stacking":{"group":"A","mode":"none"},"thresholdsStyle":{"mode":"off"}},
              "mappings":[],
              "min":0,
              "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"},{"color":"red","value":80}]},
              "unit":"ms"
            },
            "overrides":[]
          },
          "gridPos":{"h":8,"w":12,"x":12,"y":120},
          "id":31,
          "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi"}},
          "pluginVersion":"8.0.0",
          "targets":[{"exemplar":false,"expr":"rate(pg_func_total_time{ins=\"$ins\", datname=\"$datname\", funcname=~\".*$relname.*\"}[1m]) / rate(pg_func_calls{ins=\"$ins\", datname=\"$datname\", funcname=~\".*$relname.*\"}[1m])","interval":"","legendFormat":"{{ funcname }}","refId":"A"}],
          "title":"Function Duration",
          "type":"timeseries"
        }
      ],
      "title":"Functions",
      "type":"row"
    },
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":87},"id":23,"panels":[],"title":"Blocks I/O","type":"row"},
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Rate1m of rows HOT updated",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":50,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":0,
            "pointSize":2,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"always",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "max":1,
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"percentunit",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":0,"y":88},
      "id":69,
      "options":{"legend":{"calcs":["min"],"displayMode":"list","placement":"bottom","showLegend":false},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.1",
      "targets":[{"exemplar":false,"expr":"rate(pg_table_heap_blks_hit{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]) / (rate(pg_table_heap_blks_read{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]) + rate(pg_table_heap_blks_hit{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]))","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Table Heap Block Hit Rate",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Rate1m of rows HOT updated",
      "fieldConfig":{
        "defaults":{
          "color":{"fixedColor":"#f79f64","mode":"fixed"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":50,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":0,
            "pointSize":2,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"always",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "max":1,
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"percentunit",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":12,"y":88},
      "id":71,
      "options":{"legend":{"calcs":["min"],"displayMode":"list","placement":"bottom","showLegend":false},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.1",
      "targets":[{"exemplar":false,"expr":"rate(pg_table_idx_blks_hit{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]) / (rate(pg_table_idx_blks_read{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]) + rate(pg_table_idx_blks_hit{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]))","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Table Index Block Hit Rate",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Rate1m of rows HOT updated",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":50,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":0,
            "pointSize":2,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"always",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "max":1,
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"percentunit",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":5,"w":12,"x":0,"y":96},
      "id":73,
      "options":{"legend":{"calcs":["min"],"displayMode":"list","placement":"bottom","showLegend":false},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.1",
      "targets":[{"exemplar":false,"expr":"rate(pg_table_toast_blks_hit{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]) / (rate(pg_table_toast_blks_read{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]) + rate(pg_table_toast_blks_hit{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]))","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Table Toast Block Hit Rate",
      "type":"timeseries"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Rate1m of rows HOT updated",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":50,
            "gradientMode":"opacity",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":0,
            "pointSize":2,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"always",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "mappings":[],
          "max":1,
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"percentunit",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":5,"w":12,"x":12,"y":96},
      "id":74,
      "options":{"legend":{"calcs":["min"],"displayMode":"list","placement":"bottom","showLegend":false},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.1",
      "targets":[{"exemplar":false,"expr":"rate(pg_table_tidx_blks_hit{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]) / (rate(pg_table_tidx_blks_read{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]) + rate(pg_table_tidx_blks_hit{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m]))","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Table Toast Index Block Hit Rate",
      "type":"timeseries"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":101},
      "id":35,
      "panels":[
        {
          "datasource":{"type":"prometheus","uid":"ds-prometheus"},
          "description":"Vacuum and analyze activity on this table (manual or auto)",
          "fieldConfig":{"defaults":{"color":{"mode":"thresholds"},"custom":{"fillOpacity":70,"lineWidth":0,"spanNulls":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"rgba(195, 218, 254, 0.3)"},{"color":"#346f36cc","value":1},{"color":"#EAB839","value":2},{"color":"#f79f64","value":3},{"color":"red","value":4},{"color":"#b783af","value":5},{"color":"text","value":10}]}},"overrides":[]},
          "gridPos":{"h":5,"w":24,"x":0,"y":127},
          "id":80,
          "options":{"alignValue":"left","legend":{"displayMode":"list","placement":"bottom","showLegend":false},"mergeValues":true,"rowHeight":0.9,"showValue":"never","tooltip":{"mode":"single","sort":"none"}},
          "targets":[
            { "exemplar":false,"expr":"increase(pg_table_vacuum_count{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])"     ,             "interval":"","legendFormat":"Vacuum"      ,"refId":"A" },{ "exemplar":false,"expr":"increase(pg_table_autovacuum_count{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])" ,"hide":false,"interval":"","legendFormat":"Auto Vacuum" ,"refId":"B" },
            { "exemplar":false,"expr":"increase(pg_table_analyze_count{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])"    ,"hide":false,"interval":"","legendFormat":"Analyze"     ,"refId":"C" },{ "exemplar":false,"expr":"increase(pg_table_autoanalyze_count{ins=\"$ins\", datname=\"$datname\", relname=\"$relname\"}[1m])","hide":false,"interval":"","legendFormat":"Auto Analyze","refId":"D" }
          ],
          "title":"Maintenance Activity",
          "type":"state-timeline"
        }
      ],
      "title":"Vacuum & Analyze",
      "type":"row"
    }
  ],
  "preload":false,
  "refresh":"",
  "schemaVersion":41,
  "tags":["Pigsty","PGSQL","Database","Table"],
  "templating":{
    "list":[
      {"current":{},"datasource":{"type":"prometheus","uid":"ds-prometheus"},"definition":"label_values(pg_up, ins)","description":"Unique instance identifier (e.g pg-meta-1)","includeAll":false,"label":"Instance","name":"ins","options":[],"query":{"query":"label_values(pg_up, ins)","refId":"StandardVariableQuery"},"refresh":2,"regex":"","sort":1,"type":"query"},
      {"current":{},"datasource":{"type":"prometheus","uid":"ds-prometheus"},"definition":"label_values(pg_db_age{ins=\"$ins\"}, datname)","description":"Database name","includeAll":false,"label":"Database","name":"datname","options":[],"query":{"query":"label_values(pg_db_age{ins=\"$ins\"}, datname)","refId":"StandardVariableQuery"},"refresh":2,"regex":"(?!^template\\d$)(^.*$)","sort":1,"type":"query"},
      {
        "current":{},
        "datasource":{"type":"prometheus","uid":"ds-prometheus"},
        "definition":"label_values(pg_table_idx_scan{ins=\"$ins\", datname=\"$datname\"},relname)",
        "description":"Schema Qualified Table Name",
        "includeAll":false,
        "label":"Table",
        "name":"relname",
        "options":[],
        "query":{"query":"label_values(pg_table_idx_scan{ins=\"$ins\", datname=\"$datname\"},relname)","refId":"PrometheusVariableQueryEditor-VariableQuery"},
        "refresh":2,
        "regex":"",
        "sort":1,
        "type":"query"
      },{
        "current":{},
        "datasource":{"type":"prometheus","uid":"ds-prometheus"},
        "definition":"label_values(node_uname_info{ins=\"$ins\"}, nodename)",
        "description":"Node name of current postgres instance",
        "hide":2,
        "includeAll":false,
        "label":"Node",
        "name":"node",
        "options":[],
        "query":{"query":"label_values(node_uname_info{ins=\"$ins\"}, nodename)","refId":"StandardVariableQuery"},
        "refresh":2,
        "regex":"",
        "sort":1,
        "type":"query"
      },{
        "current":{},
        "datasource":{"type":"prometheus","uid":"ds-prometheus"},
        "definition":"label_values(pg_up{ins=\"$ins\"} , instance)",
        "description":"IP address of this postgres instance",
        "hide":2,
        "includeAll":false,
        "label":"IP",
        "name":"ip",
        "options":[],
        "query":{"query":"label_values(pg_up{ins=\"$ins\"} , instance)","refId":"StandardVariableQuery"},
        "refresh":2,
        "regex":"/([0-9\\.]+)\\:\\d+/",
        "sort":1,
        "type":"query"
      },{
        "current":{},
        "datasource":{"type":"prometheus","uid":"ds-prometheus"},
        "definition":"label_values(pg_up{ins=\"$ins\"},  ins)",
        "description":"Sequence number of this instance, which is an unique integer among a postgres cluster",
        "hide":2,
        "includeAll":false,
        "label":"Sequence",
        "name":"seq",
        "options":[],
        "query":{"query":"label_values(pg_up{ins=\"$ins\"},  ins)","refId":"StandardVariableQuery"},
        "refresh":2,
        "regex":"/^[a-zA-Z0-9-_]+-(\\d+)$/",
        "sort":1,
        "type":"query"
      },{
        "current":{},
        "datasource":{"type":"prometheus","uid":"ds-prometheus"},
        "definition":"label_values(pg_up{ins=\"$ins\"}, cls)",
        "description":"Cluster identifier for this postgres instance, cls should be unique among entire environment. such as pg-meta, pg-test",
        "hide":2,
        "includeAll":false,
        "label":"Cluster",
        "name":"cls",
        "options":[],
        "query":{"query":"label_values(pg_up{ins=\"$ins\"}, cls)","refId":"StandardVariableQuery"},
        "refresh":2,
        "regex":"",
        "sort":1,
        "type":"query"
      },{
        "current":{},
        "datasource":{"type":"prometheus","uid":"ds-prometheus"},
        "definition":"label_values(pg_table_idx_scan{relname=\"$relname\"},relname)",
        "description":"Schema Name",
        "hide":2,
        "includeAll":false,
        "label":"Schema",
        "name":"nspname",
        "options":[],
        "query":{"query":"label_values(pg_table_idx_scan{relname=\"$relname\"},relname)","refId":"PrometheusVariableQueryEditor-VariableQuery"},
        "refresh":2,
        "regex":"/(\\S+)\\.\\S+/",
        "sort":1,
        "type":"query"
      },{
        "current":{},
        "datasource":{"type":"prometheus","uid":"ds-prometheus"},
        "definition":"label_values(pg_table_idx_scan{relname=\"$relname\"},relname)",
        "description":"relname without schema",
        "hide":2,
        "includeAll":false,
        "label":"TableName",
        "name":"tblname",
        "options":[],
        "query":{"query":"label_values(pg_table_idx_scan{relname=\"$relname\"},relname)","refId":"PrometheusVariableQueryEditor-VariableQuery"},
        "refresh":2,
        "regex":"/\\S+\\.(\\S+)/",
        "sort":1,
        "type":"query"
      }
    ]
  },
  "time":{"from":"now-1h","to":"now"},
  "timepicker":{"refresh_intervals":["1s","2s","3s","5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"]},
  "timezone":"browser",
  "title":"PGSQL Table",
  "uid":"pgsql-table",
  "version":1
}