Files
supabase/apps/studio/components/interfaces
Jordi Enric e3eb51f428 fix(query-performance): optimize pg_stat_statements query DEBUG-28 (#43383)
- Filter out never-run queries early: previously the queries didn't
check if a statement had ever actually been executed, so PostgreSQL
would process and return those useless rows. Adding WHERE calls > 0
skips
  them upfront.
- Replace window functions with a pre-computed total: two queries were
using a SQL window function to calculate the "% of total time" column,
which forces PostgreSQL to load every single row into memory before
returning results. Replaced with a small CTE that computes the total
once separately, so PostgreSQL can apply the row limit without buffering
everything first. This was the main cause of page crashes on databases
   with a large query history.
 - slowQueriesCount bug fix: added missing as statements alias
- queryMetrics WHERE clause fix: ${where} was producing WHERE ... WHERE
..., now uses .replace(/^WHERE/, 'AND')
2026-03-05 16:33:15 +01:00
..
2026-03-05 14:59:13 +01:00
2026-03-05 11:25:01 -03:30