- "rawSql": "WITH last_fetch_time(time) AS (\n SELECT time\n FROM btree_bloat\n WHERE time <= $__timeTo()\n ORDER BY time DESC\n LIMIT 1\n)\n\nSELECT\n dbname AS \"Source Name\",\n tag_data->>'tblname' AS \"Table Name\",\n tag_data->>'idxname' AS \"Index Name\",\n data->>'real_size' AS \"Index Size\",\n data->>'bloat_pct' AS \"Estimated Bloat %\",\n data->>'bloat_size' AS \"Estimated Bloat size\"\nFROM\n btree_bloat\nWHERE time = (SELECT time FROM last_fetch_time)\n AND dbname IN ($dbname)\nORDER BY (data->>'bloat_pct')::float8 DESC\nLIMIT $top\n",
0 commit comments