import { Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogSection, DialogSectionSeparator, DialogTitle, DialogTrigger, Tooltip, TooltipContent, TooltipTrigger, } from 'ui' import { Admonition } from 'ui-patterns' import { DocsButton } from './DocsButton' import { InlineLinkClassName } from './InlineLink' import { DOCS_URL } from '@/lib/constants' import { ResponseError } from '@/types' interface HighQueryCostErrorProps { error: ResponseError suggestions?: string[] } export const HighCostError = ({ error, suggestions }: HighQueryCostErrorProps) => { // [Joshen] The CTA could be to use a read replica to query or something? return ( ) } const HighQueryCostDialog = ({ error, suggestions = [] }: HighQueryCostErrorProps) => { const metadata = error.metadata return ( event.preventDefault()}> Estimated query cost exceeds safety thresholds Preventive measure to mitigate impacting the database

The dashboard runs optimized SQL queries on your project’s database to load data for this interface.

However, the query was skipped as its{' '} estimated cost

Estimated cost: {metadata?.cost.toLocaleString()}

Determined via the EXPLAIN command

{' '} is high and could place significant load on the database.

{suggestions.length > 0 && (

You may check the following to ensure that the query cost is lower

    {suggestions.map((x) => (
  • {x}
  • ))}
)}
) }