calculateImprovement() — supabase Function Reference
Architecture documentation for the calculateImprovement() function in index-advisor.utils.ts from the supabase codebase.
Entity Profile
Dependency Diagram
graph TD 5ee88df4_951c_0803_af49_b513717887c7["calculateImprovement()"] 77095809_f5e0_ebf9_c944_46137d134758["IndexImprovementText()"] 77095809_f5e0_ebf9_c944_46137d134758 -->|calls| 5ee88df4_951c_0803_af49_b513717887c7 d55bb5d2_0fea_f272_6d89_ad97d7b149c7["QueryIndexes()"] d55bb5d2_0fea_f272_6d89_ad97d7b149c7 -->|calls| 5ee88df4_951c_0803_af49_b513717887c7 style 5ee88df4_951c_0803_af49_b513717887c7 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
apps/studio/components/interfaces/QueryPerformance/IndexAdvisor/index-advisor.utils.ts lines 27–41
export function calculateImprovement(
costBefore: number | undefined,
costAfter: number | undefined
): number {
if (
costBefore === undefined ||
costAfter === undefined ||
costBefore <= 0 ||
costBefore <= costAfter
) {
return 0
}
return ((costBefore - costAfter) / costBefore) * 100
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does calculateImprovement() do?
calculateImprovement() is a function in the supabase codebase.
What calls calculateImprovement()?
calculateImprovement() is called by 2 function(s): IndexImprovementText, QueryIndexes.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free