From b9908aec55e9a9815018b91ea972e0aca0802ee7 Mon Sep 17 00:00:00 2001 From: "kemal.earth" <606977+kemaldotearth@users.noreply.github.com> Date: Fri, 5 Dec 2025 17:22:25 +0000 Subject: [PATCH] fix(studio): scope indexes tab to just select queries (#41116) feat: scope indexes tab to just select queries --- .../QueryPerformance/QueryPerformanceGrid.tsx | 49 +++++++++++++------ 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/apps/studio/components/interfaces/QueryPerformance/QueryPerformanceGrid.tsx b/apps/studio/components/interfaces/QueryPerformance/QueryPerformanceGrid.tsx index ee5b1acd2bd..b96cbb44dab 100644 --- a/apps/studio/components/interfaces/QueryPerformance/QueryPerformanceGrid.tsx +++ b/apps/studio/components/interfaces/QueryPerformance/QueryPerformanceGrid.tsx @@ -438,6 +438,25 @@ export const QueryPerformanceGrid = ({ } }, [handleKeyDown]) + const isSelectQuery = (query: string | undefined): boolean => { + if (!query) return false + const formattedQuery = query.trim().toLowerCase() + return ( + formattedQuery.startsWith('select') || + formattedQuery.startsWith('with pgrst_source') || + formattedQuery.startsWith('with pgrst_payload') + ) + } + + useEffect(() => { + if (selectedRow !== undefined && view === 'suggestion') { + const query = reportData[selectedRow]?.query + if (!isSelectQuery(query)) { + setView('details') + } + } + }, [selectedRow, view, reportData]) + return (