diff --git a/apps/studio/components/interfaces/QueryPerformance/QueryCosts.tsx b/apps/studio/components/interfaces/QueryPerformance/QueryCosts.tsx index 7c92044d09d..197ab6ea489 100644 --- a/apps/studio/components/interfaces/QueryPerformance/QueryCosts.tsx +++ b/apps/studio/components/interfaces/QueryPerformance/QueryCosts.tsx @@ -24,17 +24,29 @@ export const QueryCosts = ({
Currently:
-{currentCost.toFixed(2)}
++ {typeof currentCost === 'number' && !isNaN(currentCost) && isFinite(currentCost) + ? currentCost.toFixed(2) + : 'N/A'} +
With index:
-{improvedCost.toFixed(2)}
- {improvement &&↓ {improvement.toFixed(1)}%
} + {improvedCost && + typeof improvedCost === 'number' && + !isNaN(improvedCost) && + isFinite(improvedCost) && ( +With index:
+{improvedCost.toFixed(2)}
+ {improvement && + typeof improvement === 'number' && + !isNaN(improvement) && + isFinite(improvement) && ( +↓ {improvement.toFixed(1)}%
+ )} +{x.name}
diff --git a/apps/studio/components/interfaces/QueryPerformance/QueryPanel.tsx b/apps/studio/components/interfaces/QueryPerformance/QueryPanel.tsx index 9852385a20b..4cee87a3ece 100644 --- a/apps/studio/components/interfaces/QueryPerformance/QueryPanel.tsx +++ b/apps/studio/components/interfaces/QueryPerformance/QueryPanel.tsx @@ -69,7 +69,7 @@ export const QueryPanelScoreSection = ({ ) : ({formattedValue}
- {isTime &&{(value / 1000).toFixed(2)}s
} + {isTime && typeof value === 'number' && !isNaN(value) && isFinite(value) && ( +{(value / 1000).toFixed(2)}s
+ )}