Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(studio): query perf update label formatting and column name (#38778)

kemal.earthcd072894760c
diff --git a/apps/studio/components/interfaces/QueryPerformance/QueryPerformance.constants.ts b/apps/studio/components/interfaces/QueryPerformance/QueryPerformance.constants.ts
index 88bd1b0cf94..18565e4d2a5 100644
--- a/apps/studio/components/interfaces/QueryPerformance/QueryPerformance.constants.ts
+++ b/apps/studio/components/interfaces/QueryPerformance/QueryPerformance.constants.ts
@@ -20,7 +20,7 @@ export const QUERY_PERFORMANCE_COLUMNS = [
{ id: 'max_time', name: 'Max time', description: undefined, minWidth: 100 },
{ id: 'mean_time', name: 'Mean time', description: undefined, minWidth: 100 },
{ id: 'min_time', name: 'Min time', description: undefined, minWidth: 100 },
- { id: 'rows_read', name: 'Rows read', description: undefined, minWidth: 100 },
+ { id: 'rows_read', name: 'Rows processed', description: undefined, minWidth: 130 },
{ id: 'cache_hit_rate', name: 'Cache hit rate', description: undefined, minWidth: 130 },
{ id: 'rolname', name: 'Role', description: undefined, minWidth: 160 },
] as const
diff --git a/apps/studio/components/interfaces/QueryPerformance/QueryPerformanceGrid.tsx b/apps/studio/components/interfaces/QueryPerformance/QueryPerformanceGrid.tsx
index e77aa1aaf62..001b8cbba4e 100644
--- a/apps/studio/components/interfaces/QueryPerformance/QueryPerformanceGrid.tsx
+++ b/apps/studio/components/interfaces/QueryPerformance/QueryPerformanceGrid.tsx
@@ -168,7 +168,7 @@ export const QueryPerformanceGrid = ({ queryPerformanceQuery }: QueryPerformance
const formattedValue =
!!value && typeof value === 'number' && !isNaN(value) && isFinite(value)
? isTime
- ? `${value.toFixed(0)}ms`
+ ? `${value.toFixed(0).toLocaleString()}ms`
: value.toLocaleString()
: ''
@@ -179,7 +179,11 @@ export const QueryPerformanceGrid = ({ queryPerformanceQuery }: QueryPerformance
<p
className={cn((value / 1000).toFixed(2) === '0.00' && 'text-foreground-lighter')}
>
- {(value / 1000).toFixed(2) + 's'}
+ {(value / 1000).toLocaleString(undefined, {
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2,
+ })}
+ s
</p>
) : (
<p className="text-muted">&ndash;</p>
@@ -207,7 +211,7 @@ export const QueryPerformanceGrid = ({ queryPerformanceQuery }: QueryPerformance
<div className="w-full flex flex-col justify-center text-xs">
{typeof value === 'number' && !isNaN(value) && isFinite(value) ? (
<p className={cn(value.toFixed(0) === '0' && 'text-foreground-lighter')}>
- {value.toFixed(0)}ms
+ {Math.round(value).toLocaleString()}ms
</p>
) : (
<p className="text-muted">&ndash;</p>
@@ -244,7 +248,11 @@ export const QueryPerformanceGrid = ({ queryPerformanceQuery }: QueryPerformance
cacheHitRateToNumber(value).toFixed(2) === '0.00' && 'text-foreground-lighter'
)}
>
- {cacheHitRateToNumber(value).toFixed(2)}%
+ {cacheHitRateToNumber(value).toLocaleString(undefined, {
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2,
+ })}
+ %
</p>
) : (
<p className="text-muted">&ndash;</p>