Never executes: Only ever compiles/plans the statement — safe to enable regardless of the source’s readonly setting
Per-dialect output: Uses EXPLAIN on PostgreSQL, MySQL, MariaDB, and SQL Server, EXPLAIN PLAN + DBMS_XPLAN on Oracle, and EXPLAIN QUERY PLAN on SQLite (bare EXPLAIN on SQLite returns low-level bytecode, not a readable plan)
Opt-in only: Not part of the default tool pair — must be explicitly enabled per source
explain_sql is opt-in. Unlike execute_sql and search_objects, it is not enabled automatically when a source has no [[tools]] entries — add it explicitly (see Enabling explain_sql below).
Pass a single SQL statement to explain. The tool adds the EXPLAIN prefix itself — do not include it in the input.
SELECT * FROM users WHERE status = 'active'
EXPLAIN SELECT * FROM users WHERE status = 'active'
Only a single statement is accepted (no ;-separated batches), and the input must not itself begin with EXPLAIN or ANALYZE — both are rejected so the tool’s own EXPLAIN prefix can never combine with a smuggled ANALYZE to actually execute the statement.
Because plain EXPLAIN never executes the target statement, explain_sql is safe to run against write statements too. explain_sql on DELETE FROM users WHERE id = 1 returns the plan without deleting anything.
See Tool Configuration for how [[tools]] entries work across multiple sources.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"DBHub, Minimal Database MCP Server","colors":{"primary":"#335DFF","light":"#E8ECFF","dark":"#0A1633"},"logo":{"light":"https://mintcdn.com/dbhub/n5kmb6SdWxcYttEU/images/logo/full-light.svg?fit=max\u0026auto=format\u0026n=n5kmb6SdWxcYttEU\u0026q=85\u0026s=024b91b786fbf5681e40ec9ca300d4fa","dark":"https://mintcdn.com/dbhub/n5kmb6SdWxcYttEU/images/logo/full-dark.svg?fit=max\u0026auto=format\u0026n=n5kmb6SdWxcYttEU\u0026q=85\u0026s=c52b0d31b0c7d0afc87e2c02cb95dd30"},"favicon":"https://mintcdn.com/dbhub/n5kmb6SdWxcYttEU/favicon.svg?fit=max\u0026auto=format\u0026n=n5kmb6SdWxcYttEU\u0026q=85\u0026s=0ba6cc55fbc04d3c1ecdfa77752d0922","navbar":{"primary":{"type":"github","href":"https://github.com/bytebase/dbhub"}},"footer":{"socials":{"github":"https://github.com/bytebase/dbhub","x":"https://x.com/Bytebase"}},"seo":{"metatags":{"canonical":"https://dbhub.ai"}},"fonts":{"family":"DM Sans"},"integrations":{"plausible":{"domain":"dbhub.ai"}},"errors":{"404":{"redirect":false}},"contextual":{"options":["copy","view"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"dbhub","hasAudioNarration":false,"actualSubdomain":"dbhub","customDomains":["dbhub.ai"],"gitSource":{"type":"github","owner":"tianzhou","repo":"dbhub","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ac8b473833404a3a8acd892","collectionId":"17bb16d4-ab80-4df9-ad48-f8392298a6ca","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ac8b473833404a3a8acd892"},"entitlements":{},"buildId":"6ac8b473833404a3a8acd892","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"default","tag":"Docs","count":17},{"language":"default","tag":"Blog","count":6},{"language":"default","tag":"MCP Tools","count":6},{"language":"default","tag":"Getting Started","count":5},{"language":"default","tag":"Configuration","count":3},{"language":"default","tag":"Workbench","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"tools/explain-sql","slug":"/tools/explain-sql","pageMetadata":{"title":"explain_sql","description":null,"href":"/tools/explain-sql"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Note,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Show the execution plan for a SQL statement without running it.`}),`\n`,_jsx(Heading,{level:`2`,id:`features`,children:`Features`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Never executes`}),`: Only ever compiles/plans the statement — safe to enable regardless of the source’s `,_jsx(_components.code,{children:`readonly`}),` setting`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Per-dialect output`}),`: Uses `,_jsx(_components.code,{children:`EXPLAIN`}),` on PostgreSQL, MySQL, MariaDB, and SQL Server, `,_jsx(_components.code,{children:`EXPLAIN PLAN`}),` + `,_jsx(_components.code,{children:`DBMS_XPLAN`}),` on Oracle, and `,_jsx(_components.code,{children:`EXPLAIN QUERY PLAN`}),` on SQLite (bare `,_jsx(_components.code,{children:`EXPLAIN`}),` on SQLite returns low-level bytecode, not a readable plan)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Opt-in only`}),`: Not part of the default tool pair — must be explicitly enabled per source`]}),`\n`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`explain_sql`}),` is `,_jsx(_components.strong,{children:`opt-in`}),`. Unlike `,_jsx(_components.code,{children:`execute_sql`}),` and `,_jsx(_components.code,{children:`search_objects`}),`, it is not enabled automatically when a source has no `,_jsx(_components.code,{children:`[[tools]]`}),` entries — add it explicitly (see `,_jsx(_components.a,{href:`#enabling-explain-sql`,children:`Enabling explain_sql`}),` below).`]})}),`\n`,_jsx(Heading,{level:`2`,id:`usage`,children:`Usage`}),`\n`,_jsxs(_components.p,{children:[`Pass a single SQL statement to explain. The tool adds the `,_jsx(_components.code,{children:`EXPLAIN`}),` prefix itself — do not include it in the input.`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Input`,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`SELECT * FROM users WHERE status = 'active'`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsx(CodeBlock,{filename:`Sent to the database`,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`EXPLAIN SELECT * FROM users WHERE status = 'active'`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),`\n`,_jsxs(_components.p,{children:[`Only a single statement is accepted (no `,_jsx(_components.code,{children:`;`}),`-separated batches), and the input must not itself begin with `,_jsx(_components.code,{children:`EXPLAIN`}),` or `,_jsx(_components.code,{children:`ANALYZE`}),` — both are rejected so the tool’s own `,_jsx(_components.code,{children:`EXPLAIN`}),` prefix can never combine with a smuggled `,_jsx(_components.code,{children:`ANALYZE`}),` to actually execute the statement.`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Because plain `,_jsx(_components.code,{children:`EXPLAIN`}),` never executes the target statement, `,_jsx(_components.code,{children:`explain_sql`}),` is safe to run against write statements too. `,_jsx(_components.code,{children:`explain_sql`}),` on `,_jsx(_components.code,{children:`DELETE FROM users WHERE id = 1`}),` returns the plan without deleting anything.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`enabling-explain_sql`,children:`Enabling explain_sql`}),`\n`,_jsxs(_components.p,{children:[`Add a `,_jsx(_components.code,{children:`[[tools]]`}),` entry with `,_jsx(_components.code,{children:`name = \"explain_sql\"`}),`. It takes no other options — no `,_jsx(_components.code,{children:`readonly`}),` or `,_jsx(_components.code,{children:`max_rows`}),` — since it’s always read-only:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`toml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`toml`,children:_jsxs(_components.code,{language:`toml`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[[`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`sources`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"production\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`dsn`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"postgres://user:pass@localhost:5432/mydb\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[[`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`tools`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"execute_sql\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"production\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`readonly`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[[`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`tools`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"search_objects\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"production\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[[`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`tools`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"explain_sql\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"production\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/tools/overview#tool-configuration`,children:`Tool Configuration`}),` for how `,_jsx(_components.code,{children:`[[tools]]`}),` entries work across multiple sources.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"explain_sql","description":null,"href":"/tools/explain-sql"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Features","slug":"features","depth":2,"children":[]},{"title":"Usage","slug":"usage","depth":2,"children":[]},{"title":"Enabling explain_sql","slug":"enabling-explain_sql","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"dbhub","siteName":"DBHub, Minimal Database MCP Server","title":"explain_sql - DBHub, Minimal Database MCP Server","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-19T16:45:08.393Z","originalFileLocation":"tools/explain-sql.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"DBHub, Minimal Database MCP Server\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dbhub/w9LIMTSLRtq3VY09/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/dbhub/w9LIMTSLRtq3VY09/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dbhub/w9LIMTSLRtq3VY09/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dbhub/w9LIMTSLRtq3VY09/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dbhub/w9LIMTSLRtq3VY09/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dbhub/w9LIMTSLRtq3VY09/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dbhub/w9LIMTSLRtq3VY09/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dbhub/w9LIMTSLRtq3VY09/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dbhub/w9LIMTSLRtq3VY09/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"explain_sql - DBHub, Minimal Database MCP Server\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"DBHub, Minimal Database MCP Server\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://dbhub.ai/tools/explain-sql\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://dbhub.mintlify.app/_mintlify/api/og/v2?division=MCP+Tools\u0026amp;title=explain_sql\u0026amp;theme=1c06404a5d8a2d47ded59ce2\u0026amp;signature=49bfe6d2be2982c8339317e5da07ac80b445b9e9bf982f8bb3d093e6811f9c3c\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"explain_sql - DBHub, Minimal Database MCP Server\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://dbhub.mintlify.app/_mintlify/api/og/v2?division=MCP+Tools\u0026amp;title=explain_sql\u0026amp;theme=1c06404a5d8a2d47ded59ce2\u0026amp;signature=49bfe6d2be2982c8339317e5da07ac80b445b9e9bf982f8bb3d093e6811f9c3c\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/dbhub/w9LIMTSLRtq3VY09/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"DBHub, Minimal Database MCP Server\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#335DFF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://dbhub.ai/tools/explain-sql\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/tools/explain-sql.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://dbhub.ai/#organization\",\"name\":\"DBHub, Minimal Database MCP Server\",\"url\":\"https://dbhub.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/dbhub/n5kmb6SdWxcYttEU/images/logo/full-light.svg?fit=max\u0026auto=format\u0026n=n5kmb6SdWxcYttEU\u0026q=85\u0026s=024b91b786fbf5681e40ec9ca300d4fa\"}},{\"@type\":\"WebSite\",\"@id\":\"https://dbhub.ai#website\",\"name\":\"DBHub, Minimal Database MCP Server\",\"url\":\"https://dbhub.ai\",\"publisher\":{\"@id\":\"https://dbhub.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://dbhub.ai/tools/explain-sql#webpage\",\"url\":\"https://dbhub.ai/tools/explain-sql\",\"name\":\"explain_sql\",\"dateModified\":\"2026-09-19T16:45:08.393Z\",\"isPartOf\":{\"@id\":\"https://dbhub.ai#website\"},\"breadcrumb\":{\"@id\":\"https://dbhub.ai/tools/explain-sql#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://dbhub.ai/tools/explain-sql#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"MCP Tools\",\"item\":\"https://dbhub.ai/tools/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"explain_sql\",\"item\":\"https://dbhub.ai/tools/explain-sql\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://dbhub.ai/tools/explain-sql#article\",\"headline\":\"explain_sql\",\"name\":\"explain_sql\",\"url\":\"https://dbhub.ai/tools/explain-sql\",\"mainEntityOfPage\":{\"@id\":\"https://dbhub.ai/tools/explain-sql#webpage\"},\"dateModified\":\"2026-09-19T16:45:08.393Z\",\"publisher\":{\"@id\":\"https://dbhub.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://dbhub.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"DBHub, Minimal Database MCP Server\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"DBHub, Minimal Database MCP Server","nav":{"global":null,"tabs":[{"tab":"Docs","groups":[{"group":"Getting Started","pages":[{"title":"Introduction","href":""},{"title":"Installation","href":"/installation"},{"title":"Quickstart","href":"/quickstart"},{"title":"MCP Bundle","href":"/mcpb"},{"title":"Claude Code Plugin","href":"/claude-code-plugin"}]},{"group":"MCP Tools","pages":[{"title":"Overview","href":"/tools/overview"},{"title":"execute_sql","href":"/tools/execute-sql"},{"title":"search_objects","description":null,"href":"/tools/search-objects"},{"title":"explain_sql","href":"/tools/explain-sql"},{"title":"health_check","description":null,"href":"/tools/health-check"},{"title":"Custom Tools","href":"/tools/custom-tools"}]},{"group":"Workbench","pages":[{"title":"Overview","href":"/workbench/overview"},{"title":"Tool Execution","href":"/workbench/tool-execution"},{"title":"Request Trace","href":"/workbench/request-trace"}]},{"group":"Configuration","pages":[{"title":"Command-Line Options","href":"/config/command-line"},{"title":"TOML Configuration","href":"/config/toml"},{"title":"Debug","href":"/config/debug"}]}]},{"tab":"Blog","pages":[{"title":"Blog","href":"/blog/dbhub-1-0-0"}]}]},"title":"explain_sql - DBHub, Minimal Database MCP Server","buildId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","deploymentId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","dynamics":[],"chunks":[]}