{
  "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"}]},
  "author":"Ruohang Feng (rh@vonng.com)",
  "description":"PGSQL Tables overview of single database",
  "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":325,"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}"}]}] }
        ]
      },
      "gridPos":{"h":6,"w":6,"x":0,"y":1},
      "id":400,
      "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":"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":"",
      "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 Tables : ${__data.fields.Instance}.${datname}","url":"/d/pgsql-tables?var-ins=${__data.fields.Instance}&var-datname=${datname}&${__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":13,"x":6,"y":1},
      "id":394,
      "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"},
      "description":"",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"mode":"gradient","type":"color-background"},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#e3e3e3e0"}]}},
        "overrides":[
          {
            "matcher":{"id":"byName","options":"Database"},
            "properties":[
              { "id":"links"             ,"value":[{"title":"PGSQL Tables : ${cls}.${__data.fields.Database}","url":"/d/pgsql-tables?var-ins=${ins}&var-datname=${__data.fields.Database}&${__url_time_range}"}]  },{ "id":"mappings"          ,"value":[{"options":{"postgres":{"color":"#808080","index":2},"template0":{"color":"#c0c0c0e0","index":0},"template1":{"color":"#a8a8a8e0","index":1}},"type":"value"}] },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                                                           },{ "id":"color"             ,"value":{"fixedColor":"#3e668f","mode":"fixed"}                                                                                                                         },
              { "id":"filterable"                                                                                                                                                                                 },{ "id":"custom.minWidth"   ,"value":120                                                                                                                                                             }
            ]
          },{
            "matcher":{"id":"byName","options":"OID"},
            "properties":[
              { "id":"links"             ,"value":[{"title":"PGCAT Database : ${ins}.${__data.fields.Database}","url":"/d/pgcat-database?var-dsn=${ins}.${__data.fields.Database}"}] },{ "id":"mappings"          ,"value":[{"options":{"from":0,"result":{"color":"#bfbfbf4d","index":0},"to":10},"type":"range"}]                                           },
              { "id":"custom.cellOptions","value":{"type":"color-text"}                                                                                                              },{ "id":"thresholds"        ,"value":{"mode":"absolute","steps":[{"color":"#3e668f"}]}                                                                                  },
              { "id":"custom.minWidth"   ,"value":80                                                                                                                                 }
            ]
          }
        ]
      },
      "gridPos":{"h":6,"w":5,"x":19,"y":1},
      "id":393,
      "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[{"desc":true,"displayName":"OID"}]},
      "pluginVersion":"12.0.0",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (datname) (pg_db_datid{ins=\"$ins\"})","format":"table","hide":false,"instant":true,"interval":"","legendFormat":"OID","refId":"O"}],
      "title":"",
      "transformations":[
        {"id":"seriesToColumns","options":{"byField":"datname"}},
        {
          "id":"organize",
          "options":{
            "excludeByName":{"Time":true,"Time 1":true,"Time 10":true,"Time 11":true,"Time 12":true,"Time 13":true,"Time 14":true,"Time 15":true,"Time 2":true,"Time 3":true,"Time 4":true,"Time 5":true,"Time 6":true,"Time 7":true,"Time 8":true,"Time 9":true,"Value #G":false,"Value #H":false,"host":true},
            "indexByName":{
              "Time 1":17,
              "Time 10":26,
              "Time 11":27,
              "Time 12":28,
              "Time 13":29,
              "Time 14":30,
              "Time 15":31,
              "Time 2":18,
              "Time 3":19,
              "Time 4":20,
              "Time 5":21,
              "Time 6":22,
              "Time 7":23,
              "Time 8":24,
              "Time 9":25,
              "Value #A":2,
              "Value #B":3,
              "Value #C":15,
              "Value #D":4,
              "Value #E":5,
              "Value #F":11,
              "Value #G":6,
              "Value #H":10,
              "Value #I":13,
              "Value #J":14,
              "Value #K":12,
              "Value #L":9,
              "Value #M":8,
              "Value #N":7,
              "Value #O":1,
              "datname":0,
              "host":16
            },
            "renameByName":{"Time 1":"","Time 7":"","Value":"OID","Value #A":"Size","Value #B":"Age","Value #C":"T","Value #D":"Backend","Value #E":"TPS","Value #F":"ConnLimit","Value #G":"RT","Value #H":"Conn%","Value #I":"D","Value #J":"P","Value #K":"PoolSize","Value #L":"Load","Value #M":"Client","Value #N":"Server","Value #O":"OID","datname":"Database","host":"Target","real_datname":"Datname"}
          }
        }
      ],
      "type":"table"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"`pg_class` and `pg_stat_user_tables` metrics",
      "fieldConfig":{
        "defaults":{"color":{"mode":"thresholds"},"custom":{"align":"center","cellOptions":{"type":"auto"},"inspect":false},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"#e3e3e3e0"}]}},
        "overrides":[
          {"matcher":{"id":"byType","options":"number"},"properties":[{"id":"mappings","value":[{"options":{"0":{"color":"#7b7b7be0","index":1,"text":"0"}},"type":"value"},{"options":{"match":"null+nan","result":{"index":0,"text":"-"}},"type":"special"}]},{"id":"custom.cellOptions","value":{"type":"color-text"}}]},
          {"matcher":{"id":"byName","options":"Relation"},"properties":[{"id":"links","value":[{"title":"PGSQL Table : ${__data.fields.Relation}","url":"/d/pgsql-table?var-ins=${ins}&var-cls=${cls}&var-datname=${datname}&var-relname=${__data.fields.Relation}&${__url_time_range}"}]},{"id":"custom.minWidth","value":200},{"id":"custom.align","value":"auto"}]},
          {
            "matcher":{"id":"byRegexp","options":"/Scan.*/"},
            "properties":[
              { "id":"custom.width"      ,"value":90                                                                                                                                                                                                       },
              { "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":{"0":{"color":"#8080807a","index":1,"text":"0"}},"type":"value"},{"options":{"match":"null+nan","result":{"color":"gray","index":0,"text":"-"}},"type":"special"}]                           }
            ]
          },{
            "matcher":{"id":"byName","options":"Row"},
            "properties":[
              { "id":"custom.width"      ,"value":110                                                                                                                                                                                                                                                                                                     },
              { "id":"unit"              ,"value":"locale"                                                                                                                                                                                                                                                                                                },
              { "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":"#b783af","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":"bytes"},{"id":"decimals"},{"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}]}}
            ]
          },{
            "matcher":{"id":"byName","options":"Row(dead)"},
            "properties":[
              { "id":"custom.width"      ,"value":110                                                                                                                                                                                                                                                                                                     },
              { "id":"unit"              ,"value":"locale"                                                                                                                                                                                                                                                                                                },
              { "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":"#b783af","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":"Scan(Seq)"},"properties":[{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":10},{"color":"#EAB839","value":100},{"color":"#f79f64","value":1000},{"color":"red","value":10000}]}}]},
          {"matcher":{"id":"byName","options":"Row(r/s)"},"properties":[{"id":"custom.width","value":80},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#807f7f"},{"color":"#3e668f","value":1},{"color":"#346f36cc","value":10},{"color":"#EAB839","value":100},{"color":"#f79f64","value":1000},{"color":"red","value":10000},{"color":"#b783af","value":100000}]}}]},
          {"matcher":{"id":"byName","options":"Row(w/s)"},"properties":[{"id":"custom.width","value":80},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#747574ba"},{"color":"#3e668f","value":1},{"color":"#346f36cc","value":10},{"color":"#fcdb72","value":100},{"color":"#f79f64","value":1000},{"color":"#E24D42","value":10000},{"color":"#b783af","value":100000}]}}]},
          {
            "matcher":{"id":"byName","options":"Dead%"},
            "properties":[{"id":"custom.width","value":80},{"id":"unit","value":"percentunit"},{"id":"thresholds","value":{"mode":"absolute","steps":[{"color":"#3e668f"},{"color":"#346f36cc","value":0.1},{"color":"#EAB839","value":0.3},{"color":"#f79f64","value":0.5},{"color":"red","value":0.7},{"color":"#b783af","value":0.99},{"color":"text","value":1}]}},{"id":"decimals","value":1}]
          },
          {"matcher":{"id":"byName","options":"OID"},"properties":[{"id":"custom.width","value":80},{"id":"links","value":[{"title":"PGCAT Table : ${__data.fields.Relation}","url":"/d/pgcat-table?var-dsn=${ins}.${datname}&var-cls=${cls}&var-datname=${datname}&var-relname=${__data.fields.Relation}&${__url_time_range}"}]},{"id":"custom.cellOptions","value":{"type":"auto"}}]}
        ]
      },
      "gridPos":{"h":14,"w":14,"x":0,"y":7},
      "id":396,
      "options":{"cellHeight":"sm","footer":{"countRows":false,"fields":"","reducer":["sum"],"show":false},"showHeader":true,"sortBy":[{"desc":true,"displayName":"Row"}]},
      "pluginVersion":"12.0.0",
      "targets":[
        {"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (relname, relid) (pg_table_relid{ins=\"$ins\"})","format":"table","instant":true,"interval":"","legendFormat":"OID","refId":"A"},
        {"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (relname) (pg_table_size_bytes{ins=\"$ins\", datname=\"$datname\"})","format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Table Size","refId":"B"},
        {"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum by (relname) (pg:table:scan_rate1m{ins=\"$ins\", datname=\"$datname\"})","format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Table Scan","refId":"C"},
        {"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum by (relname) (pg:table:scan_rate1m{ins=\"$ins\", datname=\"$datname\"})","format":"table","hide":true,"instant":true,"interval":"","legendFormat":"Primary Scan","refId":"D"},
        {"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum by (relname) (pg_table_seq_scan{ins=\"$ins\", datname=\"$datname\"})","format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Seq Scan","refId":"E"},
        {"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum by (relname) (rate(pg_table_tup_read{ins=\"$ins\", datname=\"$datname\"}[1m]))","format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Tup Read","refId":"F"},
        {"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"sum by (relname) (rate(pg_table_n_tup_mod{ins=\"$ins\", datname=\"$datname\"}[1m]))","format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Tup Mod","refId":"G"},
        {"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (relname) (pg_table_n_live_tup{ins=\"$ins\", datname=\"$datname\"})","format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Tup Live","refId":"H"},
        {"datasource":{"type":"prometheus","uid":"ds-prometheus"},"editorMode":"code","exemplar":false,"expr":"max by (relname) (pg_table_n_dead_tup{ins=\"$ins\", datname=\"$datname\"})","format":"table","hide":false,"instant":true,"interval":"","legendFormat":"Tup Dead","refId":"I"},
        {
          "datasource":{"type":"prometheus","uid":"ds-prometheus"},
          "editorMode":"code",
          "exemplar":false,
          "expr":"max by (relname) (pg_table_n_dead_tup{ins=\"$ins\", datname=\"$datname\"} / \n(pg_table_n_live_tup{ins=\"$primary\", datname=\"$datname\"} + pg_table_n_dead_tup{ins=\"$primary\", datname=\"$datname\"}))",
          "format":"table",
          "hide":false,
          "instant":true,
          "interval":"",
          "legendFormat":"Dead%",
          "refId":"J"
        }
      ],
      "title":"Tables",
      "transformations":[
        {"id":"seriesToColumns","options":{"byField":"relname"}},
        {
          "id":"organize",
          "options":{
            "excludeByName":{"Time":true,"Time 1":true,"Time 2":true,"Time 3":true,"Time 4":true,"Time 5":true,"Time 6":true,"Time 7":true,"Time 8":true,"Time 9":true,"Value #B":false,"__name__":true,"cls":true,"datname":true,"ins":true,"instance":true,"ip":true,"job":true},
            "indexByName":{"Time 1":10,"Time 10":20,"Time 2":11,"Time 3":12,"Time 4":13,"Time 5":14,"Time 6":15,"Time 7":16,"Time 8":17,"Time 9":19,"Value #A":1,"Value #B":18,"Value #C":3,"Value #D":4,"Value #E":5,"Value #F":6,"Value #G":7,"Value #H":2,"Value #I":8,"Value #J":9,"relname":0},
            "renameByName":{"Time":"","Time 2":"","Time 4":"","Value":"OID","Value #A":"OID","Value #B":"Size","Value #C":"Scan","Value #D":"Scan (P)","Value #E":"Scan(Seq)","Value #F":"Row(r/s)","Value #G":"Row(w/s)","Value #H":"Row","Value #I":"Row(dead)","Value #J":"Dead%","Value #K":"Last Vacuum","relname":"Relation"}
          }
        }
      ],
      "type":"table"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Index Scan + Seq Scan on this table per second.\n\nSize by table size, Color by table scan rate.",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"thresholds"},
          "links":[{"title":"PGSQL Table for ${__data.fields.relname}","url":"/d/pgsql-table?var-ins=${ins}&var-cls=${cls}&var-datname=${datname}&var-relname=${__data.fields.relname}&${__url_time_range}"},{"title":"PGCAT Table : ${__data.fields.relname}","url":"/d/pgcat-table?var-dsn=${ins}.${datname}&var-cls=${cls}&var-datname=${datname}&var-relname=${__data.fields.relname}&${__url_time_range}"}],
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short"
        },
        "overrides":[
          {"matcher":{"id":"byName","options":"Size"},"properties":[{"id":"unit","value":"decbytes"}]},
          {
            "matcher":{"id":"byName","options":"Scan"},
            "properties":[
              { "id":"unit"      ,"value":"reqps"                                                                                                                                                                                                                                                             },
              { "id":"thresholds","value":{"mode":"absolute","steps":[{"color":"super-light-blue"},{"color":"super-light-green","value":0.01},{"color":"#346f36cc","value":1},{"color":"super-light-yellow","value":10},{"color":"super-light-orange","value":100},{"color":"super-light-red","value":1000}]} },
              { "id":"mappings"  ,"value":[{"options":{"match":"null+nan","result":{"color":"#808080a3","index":0,"text":"inactive"}},"type":"special"}]                                                                                                                                                      }
            ]
          }
        ]
      },
      "gridPos":{"h":14,"w":10,"x":14,"y":7},
      "id":397,
      "options":{"colorByField":"Value #B","labelFields":["Value #A","Value #B"],"sizeField":"Value #A","textField":"relname","tiling":"treemapSquarify"},
      "pluginVersion":"2.1.0",
      "targets":[
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"max by (relname) (pg_table_size_bytes{cls=\"$cls\", datname=\"$datname\"})"         ,"format":"table",             "instant":true,"interval":"","intervalFactor":2,"legendFormat":"{{ relname }}","refId":"A" },
        { "datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"sum by (relname) (\n    pg:table:scan_rate1m{cls=\"$cls\", datname=\"$datname\"}\n)","format":"table","hide":false,"instant":true,"interval":"","intervalFactor":2,"legendFormat":"{{ relname }}","refId":"B" }
      ],
      "title":"Table Size & Access",
      "transformations":[{"id":"seriesToColumns","options":{"byField":"relname"}},{"id":"organize","options":{"excludeByName":{"Time 1":true,"Time 2":true},"indexByName":{"Time 1":3,"Time 2":4,"Value #A":1,"Value #B":2,"relname 1":0},"renameByName":{"Value #A":"Size","Value #B":"Scan","relname 1":"Relation"}}}],
      "type":"marcusolsson-treemap-panel"
    },
    {
      "datasource":{"type":"prometheus","uid":"ds-prometheus"},
      "description":"Index Scan + Seq Scan on this table per second",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":2,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "links":[{"title":"PGSQL Table : ${ins}.${__field.labels.relname}","url":"/d/pgsql-table?var-ins=${ins}&var-cls=${cls}&var-datname=${datname}&var-relname=${__field.labels.relname}&${__url_time_range}"}],
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short"
        },
        "overrides":[]
      },
      "gridPos":{"h":7,"w":12,"x":0,"y":21},
      "id":398,
      "options":{"legend":{"calcs":["mean"],"displayMode":"table","placement":"right","showLegend":true,"sortBy":"Mean","sortDesc":true},"tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},
      "pluginVersion":"12.0.0",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"sum by (relname) (\n    pg:table:scan_rate1m{cls=\"$cls\", datname=\"$datname\"}\n)","interval":"","intervalFactor":2,"legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Table Scan (scan/s)",
      "type":"timeseries"
    },
    {
      "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":2,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "links":[{"title":"PGSQL Table : ${__field.labels.relname}","url":"/d/pgsql-table?var-ins=${ins}&var-cls=${cls}&var-datname=${datname}&var-relname=${__field.labels.relname}&${__url_time_range}"}],
          "mappings":[],
          "min":0,
          "thresholds":{"mode":"absolute","steps":[{"color":"#346f36cc"}]},
          "unit":"short"
        },
        "overrides":[]
      },
      "gridPos":{"h":7,"w":12,"x":12,"y":21},
      "id":399,
      "options":{"legend":{"calcs":["mean"],"displayMode":"table","placement":"right","showLegend":true,"sortBy":"Mean","sortDesc":true},"tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},
      "pluginVersion":"12.0.0",
      "targets":[{"datasource":{"type":"prometheus","uid":"ds-prometheus"},"exemplar":false,"expr":"sum by (relname) (\n    rate(pg_table_tup_read{cls=\"$cls\", datname=\"$datname\"}[1m])\n)","interval":"","intervalFactor":2,"legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Tuple Read (rows/s)",
      "type":"timeseries"
    },
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":28},"id":327,"panels":[],"title":"Table Scan","type":"row"},
    {
      "datasource":{"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":10,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"short"
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":0,"y":29},
      "id":329,
      "options":{"legend":{"calcs":["max"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},
      "pluginVersion":"12.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_table_idx_scan{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Index Scan",
      "type":"timeseries"
    },
    {
      "datasource":{"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":"bars",
            "fillOpacity":100,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"short"
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":12,"y":29},
      "id":330,
      "options":{"legend":{"calcs":["max"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},
      "pluginVersion":"12.0.0",
      "targets":[{"exemplar":false,"expr":"increase(pg_table_seq_scan{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Sequential Scan",
      "type":"timeseries"
    },
    {
      "datasource":{"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":10,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"short"
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":0,"y":37},
      "id":333,
      "options":{"legend":{"calcs":["max"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},
      "pluginVersion":"12.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_table_idx_tup_fetch{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Index Scan -- Scanned Tuples",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "description":"Rate of tuples been sequential scanned",
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "barWidthFactor":0.6,
            "drawStyle":"line",
            "fillOpacity":10,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"short"
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":12,"y":37},
      "id":332,
      "options":{"legend":{"calcs":["max"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},
      "pluginVersion":"12.0.0",
      "targets":[{"expr":"rate(pg_table_seq_tup_read{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Sequential Scan -- Scanned Tuples",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":1,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"smooth",
            "lineWidth":1,
            "pointSize":2,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"always",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"short",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":0,"y":45},
      "id":331,
      "options":{"legend":{"calcs":["lastNotNull"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"expr":"rate(pg_table_idx_tup_fetch{ins=\"$ins\", datname=\"$datname\"}[1m]) / rate(pg_table_idx_scan{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Index Scan -- Rows per Scan",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":10,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"short",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":12,"y":45},
      "id":334,
      "options":{"legend":{"calcs":["lastNotNull"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"single","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"expr":"rate(pg_table_idx_tup_fetch{ins=\"$ins\", datname=\"$datname\"}[1m]) + rate(pg_table_seq_tup_read{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Total Scanned Tuples",
      "type":"timeseries"
    },
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":53},"id":336,"panels":[],"title":"Table Modify","type":"row"},
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":10,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"short",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":0,"y":54},
      "id":339,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"single","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"expr":"rate(pg_table_n_tup_ins{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Inserted",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":10,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"short",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":12,"y":54},
      "id":340,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"single","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"expr":"rate(pg_table_n_tup_del{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Deleted",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":1,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"short",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":0,"y":62},
      "id":341,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"single","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"expr":"rate(pg_table_n_tup_upd{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Updated",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":0,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":2,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"always",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"percentunit",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":12,"y":62},
      "id":342,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"single","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"expr":"rate(pg_table_n_tup_hot_upd{ins=\"$ins\", datname=\"$datname\"}[1m]) / rate(pg_table_n_tup_upd{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"HOT Updated Ratio",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":10,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"short",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":0,"y":70},
      "id":343,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"single","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"expr":"rate(pg_table_n_tup_mod{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Modified",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":10,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"short",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":12,"y":70},
      "id":344,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"single","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"expr":"rate(pg_table_n_tup_hot_upd{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"HOT Updated",
      "type":"timeseries"
    },
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":78},"id":346,"panels":[],"title":"Table Tuple","type":"row"},
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":0,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"short",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":0,"y":79},
      "id":348,
      "options":{"legend":{"calcs":["max"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"single","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"expr":"pg_table_n_live_tup{ins=\"$ins\", datname=\"$datname\"}","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Live Tuple",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":0,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"short",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":12,"y":79},
      "id":349,
      "options":{"legend":{"calcs":["max"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"single","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"expr":"pg_table_n_dead_tup{ins=\"$ins\", datname=\"$datname\"}","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Dead Tuple",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":10,
            "gradientMode":"none",
            "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":[]
      },
      "gridPos":{"h":8,"w":12,"x":0,"y":87},
      "id":350,
      "options":{"legend":{"calcs":["max"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"exemplar":false,"expr":"delta(pg_table_n_live_tup{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Live Tuple Delta",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":10,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":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",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":12,"y":87},
      "id":351,
      "options":{"legend":{"calcs":["max"],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"expr":"delta(pg_table_n_dead_tup{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
      "title":"Dead Tuple Delta",
      "type":"timeseries"
    },
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":95},"id":353,"panels":[],"title":"Index Access","type":"row"},
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":10,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"short",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":0,"y":96},
      "id":354,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"single","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_index_idx_scan{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ idxname }}","refId":"A"}],
      "title":"Index Access",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":0,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":2,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"always",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"percentunit",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":12,"y":96},
      "id":357,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_index_idx_blks_hit{ins=\"$ins\", datname=\"$datname\"}[1m]) / (rate(pg_index_idx_blks_read{ins=\"$ins\", datname=\"$datname\"}[1m]) + rate(pg_index_idx_blks_hit{ins=\"$ins\", datname=\"$datname\"}[1m]))","interval":"","legendFormat":"{{ idxname }}","refId":"A"}],
      "title":"Index Blocks Hit Ratio",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":10,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "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":"short",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":0,"y":104},
      "id":355,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_index_idx_tup_read{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ idxname }}","refId":"A"}],
      "title":"Index Entries Read",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":10,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":false,
            "lineInterpolation":"linear",
            "lineWidth":1,
            "pointSize":5,
            "scaleDistribution":{"type":"linear"},
            "showPoints":"never",
            "spanNulls":false,
            "stacking":{"group":"A","mode":"none"},
            "thresholdsStyle":{"mode":"off"}
          },
          "links":[{"title":"/d/pgsql-table?var-ins=${ins}&var-cls=${cls}&var-datname=${__field.labels.datname}&var-relname=${__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":"short",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":12,"y":104},
      "id":356,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_index_idx_tup_fetch{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ idxname }}","refId":"A"}],
      "title":"Indexed Tuples Fetched",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":1,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":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",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":0,"y":112},
      "id":358,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_index_idx_tup_read{ins=\"$ins\", datname=\"$datname\"}[1m]) / rate(pg_index_idx_scan{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ idxname }}","refId":"A"}],
      "title":"Index Entries Read per Scan",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":1,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":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",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":12,"y":112},
      "id":359,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_index_idx_tup_fetch{ins=\"$ins\", datname=\"$datname\"}[1m])  / rate(pg_index_idx_scan{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ idxname }}","refId":"A"}],
      "title":"Indexed Tuples Fetched per Scan",
      "type":"timeseries"
    },
    {"collapsed":false,"gridPos":{"h":1,"w":24,"x":0,"y":120},"id":361,"panels":[],"title":"Functions","type":"row"},
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":3,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":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",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":0,"y":121},
      "id":362,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"exemplar":false,"expr":"rate(pg_func_calls{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ funcname }}","refId":"A"}],
      "title":"Function Call",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":44,
            "gradientMode":"none",
            "hideFrom":{"legend":false,"tooltip":false,"viz":false},
            "insertNulls":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",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":12,"y":121},
      "id":366,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"expr":"rate(pg_func_total_time{ins=\"$ins\", datname=\"$datname\"}[1m]) / rate(pg_func_calls{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ funcname }}","refId":"A"}],
      "title":"Function Time Spend (Stacked)",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":6,
            "gradientMode":"none",
            "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"},{"color":"red","value":80}]},
          "unit":"ms",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":0,"y":129},
      "id":364,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"expr":"rate(pg_func_self_time{ins=\"$ins\", datname=\"$datname\"}[1m]) / rate(pg_func_calls{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ funcname }}","refId":"A"}],
      "title":"Function Duration (Self Time)",
      "type":"timeseries"
    },
    {
      "datasource":{"uid":"ds-prometheus"},
      "fieldConfig":{
        "defaults":{
          "color":{"mode":"palette-classic"},
          "custom":{
            "axisBorderShow":false,
            "axisCenteredZero":false,
            "axisColorMode":"text",
            "axisLabel":"",
            "axisPlacement":"auto",
            "barAlignment":0,
            "drawStyle":"line",
            "fillOpacity":1,
            "gradientMode":"none",
            "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"},{"color":"red","value":80}]},
          "unit":"ms",
          "unitScale":true
        },
        "overrides":[]
      },
      "gridPos":{"h":8,"w":12,"x":12,"y":129},
      "id":363,
      "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"multi","sort":"none"}},
      "pluginVersion":"8.0.0",
      "targets":[{"expr":"rate(pg_func_total_time{ins=\"$ins\", datname=\"$datname\"}[1m]) / rate(pg_func_calls{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ funcname }}","refId":"A"}],
      "title":"Function Duration",
      "type":"timeseries"
    },
    {
      "collapsed":true,
      "gridPos":{"h":1,"w":24,"x":0,"y":137},
      "id":368,
      "panels":[
        {
          "datasource":{"uid":"ds-prometheus"},
          "fieldConfig":{
            "defaults":{
              "color":{"mode":"palette-classic"},
              "custom":{
                "axisCenteredZero":false,
                "axisColorMode":"text",
                "axisLabel":"",
                "axisPlacement":"auto",
                "barAlignment":1,
                "drawStyle":"line",
                "fillOpacity":100,
                "gradientMode":"hue",
                "hideFrom":{"legend":false,"tooltip":false,"viz":false},
                "insertNulls":false,
                "lineInterpolation":"stepBefore",
                "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":"short"
            },
            "overrides":[]
          },
          "gridPos":{"h":8,"w":24,"x":0,"y":138},
          "id":370,
          "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"single","sort":"none"}},
          "pluginVersion":"8.0.0",
          "targets":[{"expr":"increase(pg_table_vacuum_count{ins=\"$ins\", datname=\"$datname\"}[1m]) + increase(pg_table_autovacuum_count{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
          "title":"Vacuum (1m)",
          "type":"timeseries"
        },{
          "datasource":{"uid":"ds-prometheus"},
          "description":"How many analyze (auto + manual) executed in last 1m on each table",
          "fieldConfig":{
            "defaults":{
              "color":{"mode":"palette-classic"},
              "custom":{
                "axisCenteredZero":false,
                "axisColorMode":"text",
                "axisLabel":"",
                "axisPlacement":"auto",
                "barAlignment":0,
                "drawStyle":"line",
                "fillOpacity":100,
                "gradientMode":"hue",
                "hideFrom":{"legend":false,"tooltip":false,"viz":false},
                "insertNulls":false,
                "lineInterpolation":"stepBefore",
                "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":"short"
            },
            "overrides":[]
          },
          "gridPos":{"h":8,"w":24,"x":0,"y":146},
          "id":371,
          "options":{"legend":{"calcs":[],"displayMode":"table","placement":"right","showLegend":true},"tooltip":{"mode":"single","sort":"none"}},
          "pluginVersion":"8.0.0",
          "targets":[{"expr":"increase(pg_table_analyze_count{ins=\"$ins\", datname=\"$datname\"}[1m]) + increase(pg_table_autoanalyze_count{ins=\"$ins\", datname=\"$datname\"}[1m])","interval":"","legendFormat":"{{ relname }}","refId":"A"}],
          "title":"Analyze (1m)",
          "type":"timeseries"
        }
      ],
      "title":"Maintenance",
      "type":"row"
    }
  ],
  "preload":false,
  "refresh":"",
  "schemaVersion":41,
  "tags":["Pigsty","PGSQL","Database"],
  "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$)(^.*$)","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(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"
      }
    ]
  },
  "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 Tables",
  "uid":"pgsql-tables",
  "version":1
}