On PlanetScale, enable TIN with the SQL below. For a local or CI database, first set up Lead.The database encoding must be UTF8 or SQL_ASCII. CREATE EXTENSION tin refuses other encodings (for example, LATIN1).
CREATE EXTENSION IF NOT EXISTS tin;
If CREATE EXTENSION fails with permission denied to create extension "tin" and Must be superuser to create this extension., your cluster needs an update before it can install TIN. Go to the Clusters page for your branch, find the “Cluster update available” indicator, and update your cluster. After the update completes, run CREATE EXTENSION again.
When a new TIN version is available, update your cluster so it restarts onto the new library. Then, in every database that already has the extension, run:
ALTER EXTENSION tin UPDATE;
The cluster update installs the new binary. ALTER EXTENSION updates the SQL catalog so new options and function signatures are visible. Changing analysis options such as stemming on a populated index also needs REINDEX.
The example below creates a table, inserts rows, and creates a TIN index on the text column:
CREATE TABLE posts ( id bigint PRIMARY KEY, category text NOT NULL, body text NOT NULL);INSERT INTO posts (id, category, body) VALUES (1, 'fruit', 'I love fuji apples and juicy mangoes'), (2, 'tasting', 'Grape tasting notes from the orchard'), (3, 'fruit', 'The best juicy fuji apple in town');CREATE INDEX posts_body_tin ON posts USING tin (body);
Each TIN index covers one text column (or a text-producing expression).The default tokenizer folds case and accents and indexes emoji as terms, so Jalapeño and jalapeno match, and ”😀” is searchable. The same tokenizer applies to indexed columns and queries. Stemming is off by default. Add WITH (stemmer = 'en') so runs, running, and run match as the same term. See Stemming.You can preview how a string is tokenized with tin.tokenize:
SELECT * FROM tin.tokenize('Jalapeño 😀');SELECT * FROM tin.tokenize('Jalapeño 😀', accent_folding => 'preserve');SELECT * FROM tin.tokenize('runs running runner', stemmer => 'en');
Order responses in a ranked list with tin.score. Add more sort keys after the score when equal scores must stay in a stable order:
SELECT id, tin.score(ctid) AS score, bodyFROM postsWHERE body ==> 'apple OR grape'ORDER BY score DESC, idLIMIT 10;
To normalize scores against the query’s best match, divide by tin.max_score(ctid), which is constant for the scan and identical on every row:
SELECT id, tin.score(ctid) AS score, tin.score(ctid) / tin.max_score(ctid) AS relativeFROM postsWHERE body ==> 'apple OR grape'ORDER BY score DESCLIMIT 10;
tin.score and tin.max_score require a TIN index scan in the same query. Outside that context, they raise an error rather than returning NULL.
Each TIN index covers one text column. Index every column you want to search, then combine ==> in SQL. tin.score(ctid) combines BM25 relevance across those fields for the row. To weight one column higher than another, use TINQL boost (^N) on that field’s query.For example, name ==> 'fuji^1.5' makes a name match count 1.5 times an unboosted notes match.
CREATE TABLE fruits ( id bigint PRIMARY KEY, name text NOT NULL, notes text NOT NULL);CREATE INDEX fruits_name_tin ON fruits USING tin (name);CREATE INDEX fruits_notes_tin ON fruits USING tin (notes);SELECT id, tin.score(ctid) AS score, name, notesFROM fruitsWHERE name ==> 'fuji^1.5' AND notes ==> 'citrus'ORDER BY score DESCLIMIT 10;
Lead is a Postgres extension for exercising TIN-compatible application SQL in local development and CI. It uses the tin extension name so you can test your application’s search queries without connecting to PlanetScale.Lead supports Postgres 17 and 18 and is built from source. Follow the Lead README for build prerequisites, local setup, and packaging instructions for your test database.
Lead is intended for small development and test datasets. It scans table rows instead of maintaining TIN’s search index, so it is not suitable for production workloads or benchmarking TIN’s performance. Use TIN on PlanetScale for production search.
Fix TINQL syntax. Keywords must be UPPERCASE (AND, not and as an operator). Explicit empty syntax ("", []) is a parse error.
Zero rows
Broaden the query (OR, fewer required terms, wildcards). Confirm you indexed the column you are searching. Check tokenization with tin.tokenize. Inputs that analyze to no tokens ('', whitespace, bare punctuation) match nothing.
Score / max_score error
Call tin.score(ctid) / tin.max_score(ctid) on a query that also has col ==> …. They require a TIN index scan and error in other contexts (including DML RETURNING without a scan). On a partitioned parent, every planned leaf needs a usable TIN index — see limitations.
Exclusion not working
Use AND NOT, not -term. - is not negation.
MATCHES finds nothing
MATCHES is not folded. Match the dictionary form (usually lowercase, accents folded): MATCHES apple.*, not MATCHES Apple.*.
Accent / case mismatch
Defaults fold both. Search jalapeno to match Jalapeño. Override with WITH (case_folding = preserve, accent_folding = preserve) if you need exact surface forms.
Inflected forms miss
Stemming is off by default. Create the index WITH (stemmer = 'en') (or another language code), then REINDEX if the index already has rows.
Fuzzy error on hyphenated term
Fuzzy needs one token after tokenization. Prefer wi-fi as a phrase ("wi fi") or drop ~N.
Fuzzy ~1 misses common typos
Start with term~2. term~1 locks the first character and treats adjacent letter swaps as two edits. Use term~0:N to allow a first-character change.
Out-of-range k1 / b / boost
k1 and query boosts must be in [0.0..10000.0]; b must be in [0.0..1.0].
Index keeps growing
The index relation grows to a high-water mark and does not shrink on its own. REINDEX shrinks it. See limitations.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"PlanetScale","description":"PlanetScale is a relational database platform for Vitess, Neki, and Postgres that gives you scale, performance, and reliability without sacrificing developer experience.","colors":{"primary":"#0e73cc","light":"#47b7f8","dark":"#f15817"},"logo":{"light":"https://mintcdn.com/planetscale-2/xUilVHToUFALai8a/logo/light.png?fit=max\u0026auto=format\u0026n=xUilVHToUFALai8a\u0026q=85\u0026s=cccd3c9fc813c01b899ab7af15a115b1","dark":"https://mintcdn.com/planetscale-2/xUilVHToUFALai8a/logo/dark.png?fit=max\u0026auto=format\u0026n=xUilVHToUFALai8a\u0026q=85\u0026s=4153888dc0ef54ddc3464738a2d7ee6e","href":"https://planetscale.com"},"favicon":"https://mintcdn.com/planetscale-2/DJh9Bv1aUZHTVDnK/favicon.svg?fit=max\u0026auto=format\u0026n=DJh9Bv1aUZHTVDnK\u0026q=85\u0026s=cc6ec9d8d0deb3450719bb4b5b6df73a","background":{"color":{"light":"#fafafa","dark":"#111111"}},"navbar":{"links":[{"href":"https://auth.planetscale.com/sign-in","label":"Log in"},{"href":"https://auth.planetscale.com/sign-up","label":"Get started"}],"primary":{"type":"button","label":"Get in touch","href":"https://planetscale.com/contact"}},"footer":{"socials":{"x":"https://twitter.com/planetscale","github":"https://github.com/planetscale","linkedin":"https://www.linkedin.com/company/planetscale","youtube":"https://www.youtube.com/c/PlanetScale","discord":"https://pscale.link/community","facebook":"https://www.facebook.com/planetscaledata"}},"seo":{"metatags":{"canonical":"https://planetscale.com/docs"}},"fonts":{"heading":{"family":"Inter"},"body":{"family":"Inter"}},"integrations":{"segment":{"key":"9Ujczlrndco2w8fcFAakL0FT4bsJCCh3"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://planetscale.com/blog"},{"anchor":"Contact Us","icon":"headset","href":"https://planetscale.com/contact"},{"anchor":"Status","icon":"signal","href":"https://www.planetscalestatus.com/"},{"anchor":"Benchmarks","icon":"chart-line","href":"https://planetscale.com/benchmarks"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"planetscale-2","hasAudioNarration":false,"actualSubdomain":"planetscale-2","customDomains":["planetscale.com"],"gitSource":{"type":"github","owner":"planetscale","repo":"www","deployBranch":"main","contentDirectory":"content/mintlify/docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae0d00e8f66b62075dabe46","collectionId":"97da3369-b90a-4cba-9879-e53bf4caef1e","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae0d00e8f66b62075dabe46"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae10d37cc5d3160cbaf221b","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"default","tag":"Platform","count":286},{"language":"default","tag":"API Reference","count":262},{"language":"default","tag":"Vitess","count":182},{"language":"default","tag":"Postgres","count":108},{"language":"default","tag":"General API endpoints","count":93},{"language":"default","tag":"Vitess API endpoints","count":59},{"language":"default","tag":"Neki","count":58},{"language":"default","tag":"Guides","count":58},{"language":"default","tag":"Neki API endpoints","count":50},{"language":"default","tag":"Postgres API endpoints","count":46}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"type":"link","url":"https://planetscale.com/contact?initial=support"}},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"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}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#content-container{column-gap:2rem}.nav-tabs{column-gap:.5em}.nav-tabs-item{padding:0 8px}.eyebrow,.light #navigation-items .text-gray-700,.nav-tabs a{color:#616161}#navigation-items .text-primary,#topbar-cta-button .text-white,#topbar-cta-button svg,.nav-tabs a.text-primary{color:#1a1a1a}.nav-tabs a.text-primary .bg-primary{background-color:#1a1a1a;left:0}.dark .nav-tabs a[href='/docs/vitess'i].text-primary,.nav-tabs a[href='/docs/vitess'i].text-primary{color:#f15817}.dark .nav-tabs a[href='/docs/vitess'i].text-primary .bg-primary,.nav-tabs a[href='/docs/vitess'i].text-primary .bg-primary{background-color:#f15817}.nav-tabs a[href='/docs/postgres'i].text-primary{color:#0e73cc}.nav-tabs a[href='/docs/postgres'i].text-primary .bg-primary{background-color:#0e73cc}.nav-tabs a[href='/docs/neki'i].text-primary{color:#8f7200}.nav-tabs a[href='/docs/neki'i].text-primary .bg-primary{background-color:#8f7200}.dark .nav-tabs a{color:#a1a1a1}.dark #navigation-items .text-primary,.dark .nav-tabs a.text-primary{color:#fafafa}.dark .nav-tabs a.text-primary .bg-primary{background-color:#fafafa}.dark .nav-tabs a[href='/docs/postgres'i].text-primary{color:#47b7f8}.dark .nav-tabs a[href='/docs/postgres'i].text-primary .bg-primary{background-color:#47b7f8}.dark .nav-tabs a[href='/docs/neki'i].text-primary{color:#fbca00}.dark .nav-tabs a[href='/docs/neki'i].text-primary .bg-primary{background-color:#fbca00}.prose:is(.dark *){color:#c1c1c1}.prose :where(a):not(:where([class~='not-prose'], [class~='not-prose'] *)){color:#0e73cc;font-weight:500}.dark .prose :where(a):not(:where(.not-prose, .not-prose *)){color:#47b7f8}.dark .eyebrow{color:#a1a1a1}@media (min-width:1024px){#content-container{padding-top:2rem;padding-right:2rem;padding-left:2.5rem}}#topbar-cta-button a>span{background-color:#fbca00}.group:hover span{opacity:1!important}.bg-primary\\/10{background-color:rgba(129,129,129,.1)}.dark .bg-primary\\/10{background-color:rgba(255,255,255,.1)}body[data-current-path^='/vitess'] svg.bg-primary{background-color:#f15817}body[data-current-path^='/vitess'] .border-primary{border-color:#f15817}body[data-current-path^='/vitess'] #table-of-contents-content .text-primary,body[data-current-path^='/vitess'] .eyebrow{color:#f15817}body[data-current-path^='/vitess'] .card-group a:hover{border-color:#f15817!important}body[data-current-path^='/postgres'] .eyebrow{color:#0e73cc}.dark body[data-current-path^='/postgres'] .eyebrow{color:#47b7f8}body[data-current-path^='/neki'] svg.bg-primary{background-color:#8f7200}body[data-current-path^='/neki'] [data-component-part=card-icon]{background-color:#fbca00}body[data-current-path^='/neki'] [data-component-part=card-icon] svg.bg-primary{background-color:#1a1a1a;transform:scale(.7);transform-origin:center}body[data-current-path^='/neki'] .border-primary{border-color:#8f7200}body[data-current-path^='/neki'] #table-of-contents-content .text-primary{color:#1a1a1a;background-color:transparent;border-color:#fbca00}body[data-current-path^='/neki'] .eyebrow{display:inline-flex;align-items:center;width:fit-content;height:auto;min-height:1.25rem;padding:0 .375rem;color:#1a1a1a;background-color:#fbca00}body[data-current-path^='/neki'] .eyebrow:empty,body[data-current-path^='/neki'] .eyebrow[data-empty]{display:none}.dark body[data-current-path^='/neki'] .card-group .card:hover,body[data-current-path^='/neki'] .card-group .card:hover{--primary:251 202 0;--primary-light:251 202 0;border-color:#fbca00!important}.dark body[data-current-path^='/neki'] [data-component-part=card-icon],.dark body[data-current-path^='/neki'] svg.bg-primary{background-color:#fbca00}.dark body[data-current-path^='/neki'] [data-component-part=card-icon] svg.bg-primary{background-color:#1a1a1a}.dark body[data-current-path^='/neki'] .border-primary{border-color:#fbca00}.dark body[data-current-path^='/neki'] #table-of-contents-content .text-primary{color:#fafafa;background-color:transparent;border-color:#fbca00}.dark body[data-current-path^='/neki'] .eyebrow{color:#1a1a1a;background-color:#fbca00}footer div:last-child{display:none}#header,#pagination a,[data-component-part=card-content-container],[data-component-part=frame-caption]{text-wrap:balance}.step:last-of-type [data-component-part=step-line]{opacity:0}"}],"page":{"pagePath":"postgres/search/get-started","slug":"/postgres/search/get-started","pageMetadata":{"title":"Get started with TIN","sidebarTitle":"Get started","description":"Install the `tin` extension, create a TIN index, and run TINQL queries with BM25 ranking.","og:image":"images/og/postgres/search/get-started.png","href":"/postgres/search/get-started"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"Install the \", _jsx(_components.code, {\n children: \"tin\"\n }), \" extension, create a TIN index, and run TINQL queries with BM25 ranking.\"]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const __snippet_platformLabels_3vlljw={vitess:`Vitess`,postgres:`Postgres`,neki:`Neki`};const __snippet_combinedPlatformLabels_3vlljw={both:`Vitess and Postgres`,all:`Vitess, Neki, and Postgres`,\"postgres-neki\":`Postgres and Neki`};const __snippet_platformBadgeClassName_3vlljw=`inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border px-2.5 py-1 text-[13px] font-semibold leading-tight no-underline data-[engine=vitess]:data-[state=current]:border-[#ffc59b] data-[engine=vitess]:data-[state=current]:bg-[#ffe8d8] data-[engine=vitess]:data-[state=current]:text-[#672002] dark:data-[engine=vitess]:data-[state=current]:border-[#962d00] dark:data-[engine=vitess]:data-[state=current]:bg-[#3c1403] dark:data-[engine=vitess]:data-[state=current]:text-[#ffe8d8] data-[engine=vitess]:data-[state=link]:border-[#ffc59b] data-[engine=vitess]:data-[state=link]:bg-transparent data-[engine=vitess]:data-[state=link]:text-[#b83a05] dark:data-[engine=vitess]:data-[state=link]:border-[#962d00] dark:data-[engine=vitess]:data-[state=link]:bg-transparent dark:data-[engine=vitess]:data-[state=link]:text-[#ffc59b] data-[engine=postgres]:data-[state=current]:border-[#a9dffe] data-[engine=postgres]:data-[state=current]:bg-[#ddf2ff] data-[engine=postgres]:data-[state=current]:text-[#0e3682] dark:data-[engine=postgres]:data-[state=current]:border-[#144eb6] dark:data-[engine=postgres]:data-[state=current]:bg-[#08204e] dark:data-[engine=postgres]:data-[state=current]:text-[#ddf2ff] data-[engine=postgres]:data-[state=link]:border-[#a9dffe] data-[engine=postgres]:data-[state=link]:bg-transparent data-[engine=postgres]:data-[state=link]:text-[#0b6ec5] dark:data-[engine=postgres]:data-[state=link]:border-[#144eb6] dark:data-[engine=postgres]:data-[state=link]:bg-transparent dark:data-[engine=postgres]:data-[state=link]:text-[#73c7f9] data-[engine=neki]:data-[state=current]:border-[#fbca00] data-[engine=neki]:data-[state=current]:bg-[#fbca00] data-[engine=neki]:data-[state=current]:text-[#1a1a1a] dark:data-[engine=neki]:data-[state=current]:border-[#fbca00] dark:data-[engine=neki]:data-[state=current]:bg-[#fbca00] dark:data-[engine=neki]:data-[state=current]:text-[#1a1a1a] data-[engine=neki]:data-[state=link]:border-[#fbca00] data-[engine=neki]:data-[state=link]:bg-transparent data-[engine=neki]:data-[state=link]:text-[#8f7200] dark:data-[engine=neki]:data-[state=link]:border-[#fbca00] dark:data-[engine=neki]:data-[state=link]:bg-transparent dark:data-[engine=neki]:data-[state=link]:text-[#fbca00] data-[engine=both]:data-[state=current]:border-[#d4d4d4] data-[engine=both]:data-[state=current]:bg-[#f0f0f0] data-[engine=both]:data-[state=current]:text-[#3d3d3d] dark:data-[engine=both]:data-[state=current]:border-[#525252] dark:data-[engine=both]:data-[state=current]:bg-[#2a2a2a] dark:data-[engine=both]:data-[state=current]:text-[#e5e5e5]`;const __snippet_docsHref_3vlljw=path=>path.startsWith(`/`)?path:`/${path}`;const __snippet_PlatformAvailabilityBadges_3vlljw=({current,vitess,postgres,neki})=>{const _components={a:`a`,..._provideComponents()};if(__snippet_combinedPlatformLabels_3vlljw[current]){return _jsx(`div`,{className:`not-prose mint-mb-5 mint-flex mint-flex-wrap mint-items-center mint-gap-2`,role:`group`,\"aria-label\":`Platform availability`,children:_jsx(`span`,{\"data-engine\":`both`,\"data-state\":`current`,\"aria-current\":`true`,className:`mint-inline-flex mint-items-center mint-gap-1.5 mint-whitespace-nowrap mint-rounded-full mint-border mint-px-2.5 mint-py-1 mint-text-[13px] mint-font-semibold mint-leading-tight mint-no-underline data-[engine=vitess]:data-[state=current]:mint-border-[#ffc59b] data-[engine=vitess]:data-[state=current]:mint-bg-[#ffe8d8] data-[engine=vitess]:data-[state=current]:mint-text-[#672002] dark:data-[engine=vitess]:data-[state=current]:mint-border-[#962d00] dark:data-[engine=vitess]:data-[state=current]:mint-bg-[#3c1403] dark:data-[engine=vitess]:data-[state=current]:mint-text-[#ffe8d8] data-[engine=vitess]:data-[state=link]:mint-border-[#ffc59b] data-[engine=vitess]:data-[state=link]:mint-bg-transparent data-[engine=vitess]:data-[state=link]:mint-text-[#b83a05] dark:data-[engine=vitess]:data-[state=link]:mint-border-[#962d00] dark:data-[engine=vitess]:data-[state=link]:mint-bg-transparent dark:data-[engine=vitess]:data-[state=link]:mint-text-[#ffc59b] data-[engine=postgres]:data-[state=current]:mint-border-[#a9dffe] data-[engine=postgres]:data-[state=current]:mint-bg-[#ddf2ff] data-[engine=postgres]:data-[state=current]:mint-text-[#0e3682] dark:data-[engine=postgres]:data-[state=current]:mint-border-[#144eb6] dark:data-[engine=postgres]:data-[state=current]:mint-bg-[#08204e] dark:data-[engine=postgres]:data-[state=current]:mint-text-[#ddf2ff] data-[engine=postgres]:data-[state=link]:mint-border-[#a9dffe] data-[engine=postgres]:data-[state=link]:mint-bg-transparent data-[engine=postgres]:data-[state=link]:mint-text-[#0b6ec5] dark:data-[engine=postgres]:data-[state=link]:mint-border-[#144eb6] dark:data-[engine=postgres]:data-[state=link]:mint-bg-transparent dark:data-[engine=postgres]:data-[state=link]:mint-text-[#73c7f9] data-[engine=neki]:data-[state=current]:mint-border-[#fbca00] data-[engine=neki]:data-[state=current]:mint-bg-[#fbca00] data-[engine=neki]:data-[state=current]:mint-text-[#1a1a1a] dark:data-[engine=neki]:data-[state=current]:mint-border-[#fbca00] dark:data-[engine=neki]:data-[state=current]:mint-bg-[#fbca00] dark:data-[engine=neki]:data-[state=current]:mint-text-[#1a1a1a] data-[engine=neki]:data-[state=link]:mint-border-[#fbca00] data-[engine=neki]:data-[state=link]:mint-bg-transparent data-[engine=neki]:data-[state=link]:mint-text-[#8f7200] dark:data-[engine=neki]:data-[state=link]:mint-border-[#fbca00] dark:data-[engine=neki]:data-[state=link]:mint-bg-transparent dark:data-[engine=neki]:data-[state=link]:mint-text-[#fbca00] data-[engine=both]:data-[state=current]:mint-border-[#d4d4d4] data-[engine=both]:data-[state=current]:mint-bg-[#f0f0f0] data-[engine=both]:data-[state=current]:mint-text-[#3d3d3d] dark:data-[engine=both]:data-[state=current]:mint-border-[#525252] dark:data-[engine=both]:data-[state=current]:mint-bg-[#2a2a2a] dark:data-[engine=both]:data-[state=current]:mint-text-[#e5e5e5]`,children:__snippet_combinedPlatformLabels_3vlljw[current]})})}const paths={vitess,postgres,neki};const others=[`vitess`,`neki`,`postgres`].filter(engine=>engine!==current\u0026\u0026paths[engine]);const engines=__snippet_platformLabels_3vlljw[current]?[current,...others]:others;const only=engines.length===1;return _jsx(`div`,{className:`not-prose mint-mb-5 mint-flex mint-flex-wrap mint-items-center mint-gap-2`,role:`group`,\"aria-label\":`Platform availability`,children:engines.map(engine=>{const label=only?`${__snippet_platformLabels_3vlljw[engine]} only`:__snippet_platformLabels_3vlljw[engine];if(engine===current){return _jsx(`span`,{\"data-engine\":engine,\"data-state\":`current`,\"aria-current\":`true`,className:`mint-inline-flex mint-items-center mint-gap-1.5 mint-whitespace-nowrap mint-rounded-full mint-border mint-px-2.5 mint-py-1 mint-text-[13px] mint-font-semibold mint-leading-tight mint-no-underline data-[engine=vitess]:data-[state=current]:mint-border-[#ffc59b] data-[engine=vitess]:data-[state=current]:mint-bg-[#ffe8d8] data-[engine=vitess]:data-[state=current]:mint-text-[#672002] dark:data-[engine=vitess]:data-[state=current]:mint-border-[#962d00] dark:data-[engine=vitess]:data-[state=current]:mint-bg-[#3c1403] dark:data-[engine=vitess]:data-[state=current]:mint-text-[#ffe8d8] data-[engine=vitess]:data-[state=link]:mint-border-[#ffc59b] data-[engine=vitess]:data-[state=link]:mint-bg-transparent data-[engine=vitess]:data-[state=link]:mint-text-[#b83a05] dark:data-[engine=vitess]:data-[state=link]:mint-border-[#962d00] dark:data-[engine=vitess]:data-[state=link]:mint-bg-transparent dark:data-[engine=vitess]:data-[state=link]:mint-text-[#ffc59b] data-[engine=postgres]:data-[state=current]:mint-border-[#a9dffe] data-[engine=postgres]:data-[state=current]:mint-bg-[#ddf2ff] data-[engine=postgres]:data-[state=current]:mint-text-[#0e3682] dark:data-[engine=postgres]:data-[state=current]:mint-border-[#144eb6] dark:data-[engine=postgres]:data-[state=current]:mint-bg-[#08204e] dark:data-[engine=postgres]:data-[state=current]:mint-text-[#ddf2ff] data-[engine=postgres]:data-[state=link]:mint-border-[#a9dffe] data-[engine=postgres]:data-[state=link]:mint-bg-transparent data-[engine=postgres]:data-[state=link]:mint-text-[#0b6ec5] dark:data-[engine=postgres]:data-[state=link]:mint-border-[#144eb6] dark:data-[engine=postgres]:data-[state=link]:mint-bg-transparent dark:data-[engine=postgres]:data-[state=link]:mint-text-[#73c7f9] data-[engine=neki]:data-[state=current]:mint-border-[#fbca00] data-[engine=neki]:data-[state=current]:mint-bg-[#fbca00] data-[engine=neki]:data-[state=current]:mint-text-[#1a1a1a] dark:data-[engine=neki]:data-[state=current]:mint-border-[#fbca00] dark:data-[engine=neki]:data-[state=current]:mint-bg-[#fbca00] dark:data-[engine=neki]:data-[state=current]:mint-text-[#1a1a1a] data-[engine=neki]:data-[state=link]:mint-border-[#fbca00] data-[engine=neki]:data-[state=link]:mint-bg-transparent data-[engine=neki]:data-[state=link]:mint-text-[#8f7200] dark:data-[engine=neki]:data-[state=link]:mint-border-[#fbca00] dark:data-[engine=neki]:data-[state=link]:mint-bg-transparent dark:data-[engine=neki]:data-[state=link]:mint-text-[#fbca00] data-[engine=both]:data-[state=current]:mint-border-[#d4d4d4] data-[engine=both]:data-[state=current]:mint-bg-[#f0f0f0] data-[engine=both]:data-[state=current]:mint-text-[#3d3d3d] dark:data-[engine=both]:data-[state=current]:mint-border-[#525252] dark:data-[engine=both]:data-[state=current]:mint-bg-[#2a2a2a] dark:data-[engine=both]:data-[state=current]:mint-text-[#e5e5e5]`,children:label},engine)}return _jsxs(_components.a,{href:__snippet_docsHref_3vlljw(paths[engine]),\"data-engine\":engine,\"data-state\":`link`,title:`View ${__snippet_platformLabels_3vlljw[engine]} documentation`,className:`mint-inline-flex mint-items-center mint-gap-1.5 mint-whitespace-nowrap mint-rounded-full mint-border mint-px-2.5 mint-py-1 mint-text-[13px] mint-font-semibold mint-leading-tight mint-no-underline data-[engine=vitess]:data-[state=current]:mint-border-[#ffc59b] data-[engine=vitess]:data-[state=current]:mint-bg-[#ffe8d8] data-[engine=vitess]:data-[state=current]:mint-text-[#672002] dark:data-[engine=vitess]:data-[state=current]:mint-border-[#962d00] dark:data-[engine=vitess]:data-[state=current]:mint-bg-[#3c1403] dark:data-[engine=vitess]:data-[state=current]:mint-text-[#ffe8d8] data-[engine=vitess]:data-[state=link]:mint-border-[#ffc59b] data-[engine=vitess]:data-[state=link]:mint-bg-transparent data-[engine=vitess]:data-[state=link]:mint-text-[#b83a05] dark:data-[engine=vitess]:data-[state=link]:mint-border-[#962d00] dark:data-[engine=vitess]:data-[state=link]:mint-bg-transparent dark:data-[engine=vitess]:data-[state=link]:mint-text-[#ffc59b] data-[engine=postgres]:data-[state=current]:mint-border-[#a9dffe] data-[engine=postgres]:data-[state=current]:mint-bg-[#ddf2ff] data-[engine=postgres]:data-[state=current]:mint-text-[#0e3682] dark:data-[engine=postgres]:data-[state=current]:mint-border-[#144eb6] dark:data-[engine=postgres]:data-[state=current]:mint-bg-[#08204e] dark:data-[engine=postgres]:data-[state=current]:mint-text-[#ddf2ff] data-[engine=postgres]:data-[state=link]:mint-border-[#a9dffe] data-[engine=postgres]:data-[state=link]:mint-bg-transparent data-[engine=postgres]:data-[state=link]:mint-text-[#0b6ec5] dark:data-[engine=postgres]:data-[state=link]:mint-border-[#144eb6] dark:data-[engine=postgres]:data-[state=link]:mint-bg-transparent dark:data-[engine=postgres]:data-[state=link]:mint-text-[#73c7f9] data-[engine=neki]:data-[state=current]:mint-border-[#fbca00] data-[engine=neki]:data-[state=current]:mint-bg-[#fbca00] data-[engine=neki]:data-[state=current]:mint-text-[#1a1a1a] dark:data-[engine=neki]:data-[state=current]:mint-border-[#fbca00] dark:data-[engine=neki]:data-[state=current]:mint-bg-[#fbca00] dark:data-[engine=neki]:data-[state=current]:mint-text-[#1a1a1a] data-[engine=neki]:data-[state=link]:mint-border-[#fbca00] data-[engine=neki]:data-[state=link]:mint-bg-transparent data-[engine=neki]:data-[state=link]:mint-text-[#8f7200] dark:data-[engine=neki]:data-[state=link]:mint-border-[#fbca00] dark:data-[engine=neki]:data-[state=link]:mint-bg-transparent dark:data-[engine=neki]:data-[state=link]:mint-text-[#fbca00] data-[engine=both]:data-[state=current]:mint-border-[#d4d4d4] data-[engine=both]:data-[state=current]:mint-bg-[#f0f0f0] data-[engine=both]:data-[state=current]:mint-text-[#3d3d3d] dark:data-[engine=both]:data-[state=current]:mint-border-[#525252] dark:data-[engine=both]:data-[state=current]:mint-bg-[#2a2a2a] dark:data-[engine=both]:data-[state=current]:mint-text-[#e5e5e5]`,children:[label,_jsx(`svg`,{\"aria-hidden\":`true`,width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,className:`mint-shrink-0`,children:_jsx(`path`,{d:`M2.5 6h7M6.5 3l3 3-3 3`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})]},engine)})})};const __snippet_PlatformAvailabilityText_3vlljw=({current,vitess,postgres,neki})=>{const _components={a:`a`,..._provideComponents()};return __snippet_combinedPlatformLabels_3vlljw[current]?_jsxs(`p`,{children:[`Available for `,__snippet_combinedPlatformLabels_3vlljw[current],`.`]}):_jsxs(_Fragment,{children:[_jsxs(`p`,{children:[`This page covers `,__snippet_platformLabels_3vlljw[current],`.`]}),vitess\u0026\u0026current!==`vitess`?_jsxs(`p`,{children:[`Vitess version: `,_jsx(_components.a,{href:vitess.startsWith(`/`)?vitess:`/`+vitess,children:__snippet_platformLabels_3vlljw.vitess})]}):null,postgres\u0026\u0026current!==`postgres`?_jsxs(`p`,{children:[`Postgres version: `,_jsx(_components.a,{href:postgres.startsWith(`/`)?postgres:`/`+postgres,children:__snippet_platformLabels_3vlljw.postgres})]}):null,neki\u0026\u0026current!==`neki`?_jsxs(`p`,{children:[`Neki version: `,_jsx(_components.a,{href:neki.startsWith(`/`)?neki:`/`+neki,children:__snippet_platformLabels_3vlljw.neki})]}):null]})};const PlatformAvailability=props=>{const{Visibility}=_provideComponents()||{};if(!Visibility)_missingMdxReference(`Visibility`,true);return _jsxs(_Fragment,{children:[_jsx(Visibility,{for:`humans`,children:_jsx(__snippet_PlatformAvailabilityBadges_3vlljw,{...props})}),_jsx(Visibility,{for:`agents`,children:_jsx(__snippet_PlatformAvailabilityText_3vlljw,{...props})})]})};function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning,_MdxComponentBoundary}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsx(_MdxComponentBoundary,{name:`PlatformAvailability`,children:_jsx(PlatformAvailability,{current:`postgres`})}),`\n`,_jsx(Heading,{level:`2`,id:`install-the-extension`,children:`Install the extension`}),`\n`,_jsxs(_components.p,{children:[`On PlanetScale, enable TIN with the SQL below. For a local or CI database, first `,_jsx(_components.a,{href:`#local-development-and-ci`,children:`set up Lead`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`The database encoding must be `,_jsx(_components.code,{children:`UTF8`}),` or `,_jsx(_components.code,{children:`SQL_ASCII`}),`. `,_jsx(_components.code,{children:`CREATE EXTENSION tin`}),` refuses other encodings (for example, `,_jsx(_components.code,{children:`LATIN1`}),`).`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`sql`,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:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CREATE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` EXTENSION `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`IF`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` NOT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` EXISTS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tin;`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`If `,_jsx(_components.code,{children:`CREATE EXTENSION`}),` fails with `,_jsx(_components.code,{children:`permission denied to create extension \"tin\"`}),` and `,_jsx(_components.code,{children:`Must be superuser to create this extension.`}),`, your cluster needs an update before it can install TIN. Go to the `,_jsx(_components.strong,{children:`Clusters`}),` page for your branch, find the “Cluster update available” indicator, and `,_jsx(_components.a,{href:`/postgres/cluster-configuration/updates`,children:`update your cluster`}),`. After the update completes, run `,_jsx(_components.code,{children:`CREATE EXTENSION`}),` again.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`upgrade-the-extension`,children:`Upgrade the extension`}),`\n`,_jsxs(_components.p,{children:[`When a new TIN version is available, `,_jsx(_components.a,{href:`/postgres/cluster-configuration/updates`,children:`update your cluster`}),` so it restarts onto the new library. Then, in every database that already has the extension, run:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`sql`,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:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ALTER`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` EXTENSION tin `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`UPDATE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The cluster update installs the new binary. `,_jsx(_components.code,{children:`ALTER EXTENSION`}),` updates the SQL catalog so new options and function signatures are visible. Changing analysis options such as `,_jsx(_components.a,{href:`/postgres/search/reference/indexes#stemming`,children:`stemming`}),` on a populated index also needs `,_jsx(_components.code,{children:`REINDEX`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`create-a-table-and-index`,children:`Create a table and index`}),`\n`,_jsxs(_components.p,{children:[`The example below creates a table, inserts rows, and creates a TIN index on the `,_jsx(_components.code,{children:`text`}),` column:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`sql`,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:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CREATE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` TABLE`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` posts`}),_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\":`#D4D4D4`},children:` id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`bigint`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` PRIMARY KEY`}),_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\":`#D4D4D4`},children:` category `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`text`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` NOT NULL`}),_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\":`#D4D4D4`},children:` body `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`text`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` NOT NULL`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`INSERT INTO`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` posts (id, category, body) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`VALUES`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'fruit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'I love fuji apples and juicy mangoes'`}),_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\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'tasting'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Grape tasting notes from the orchard'`}),_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\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'fruit'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'The best juicy fuji apple in town'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CREATE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` INDEX`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` posts_body_tin`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` posts `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`USING`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tin (body);`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Each TIN index covers one text column (or a text-producing expression).`}),`\n`,_jsxs(_components.p,{children:[`The default tokenizer folds case and accents and indexes emoji as terms, so `,_jsx(_components.code,{children:`Jalapeño`}),` and `,_jsx(_components.code,{children:`jalapeno`}),` match, and ”😀” is searchable. The same tokenizer applies to indexed columns and queries. Stemming is off by default. Add `,_jsx(_components.code,{children:`WITH (stemmer = 'en')`}),` so `,_jsx(_components.code,{children:`runs`}),`, `,_jsx(_components.code,{children:`running`}),`, and `,_jsx(_components.code,{children:`run`}),` match as the same term. See `,_jsx(_components.a,{href:`/postgres/search/reference/indexes#stemming`,children:`Stemming`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`You can preview how a string is tokenized with `,_jsx(_components.code,{children:`tin.tokenize`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`sql`,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:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` *`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` FROM`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` tin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`tokenize`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Jalapeño 😀'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` *`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` FROM`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` tin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`tokenize`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Jalapeño 😀'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, accent_folding `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'preserve'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` *`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` FROM`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` tin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`tokenize`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'runs running runner'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, stemmer `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'en'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`You can also create `,_jsx(_components.a,{href:`/postgres/search/reference/indexes#partial-and-expression-indexes`,children:`partial indexes`}),`, `,_jsx(_components.a,{href:`/postgres/search/reference/indexes#partial-and-expression-indexes`,children:`expression indexes`}),`, and set per-index BM25 and tokenization options with `,_jsx(_components.a,{href:`/postgres/search/reference/indexes#index-options-with`,children:_jsx(_components.code,{children:`WITH (k1, b, tokenizer, stemmer, …)`})}),`. After changing analysis options on a populated index, `,_jsx(_components.code,{children:`REINDEX`}),` so existing rows are re-tokenized.`]}),`\n`,_jsx(Heading,{level:`2`,id:`your-first-queries`,children:`Your first queries`}),`\n`,_jsx(_components.p,{children:`TINQL keywords are UPPERCASE. Lowercase tokens are terms. Quote a multi-word phrase (“fuji apple”).`}),`\n`,_jsx(Heading,{level:`3`,id:`filter`,children:`Filter`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`sql`,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:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` id, body`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` posts`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WHERE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` body `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'apple AND \"fuji apple\"'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`ranked-results-bm25`,children:`Ranked results (BM25)`}),`\n`,_jsxs(_components.p,{children:[`Order responses in a ranked list with `,_jsx(_components.code,{children:`tin.score`}),`. Add more sort keys after the score when equal scores must stay in a stable order:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`sql`,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:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` id, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`tin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`score`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(ctid) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`AS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` score, body`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` posts`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WHERE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` body `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'apple OR grape'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ORDER BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` score `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`DESC`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, id`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`LIMIT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`To normalize scores against the query’s best match, divide by `,_jsx(_components.code,{children:`tin.max_score(ctid)`}),`, which is constant for the scan and identical on every row:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`sql`,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:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` id,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` tin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`score`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(ctid) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`AS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` score,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` tin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`score`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(ctid) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` tin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`max_score`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(ctid) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`AS`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` relative`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` posts`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WHERE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` body `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'apple OR grape'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ORDER BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` score `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`DESC`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`LIMIT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`tin.score`}),` and `,_jsx(_components.code,{children:`tin.max_score`}),` require a TIN index scan in the same query. Outside that context, they raise an error rather than returning NULL.`]}),`\n`,_jsx(Heading,{level:`3`,id:`count`,children:`Count`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`count(*)`}),` over a TIN predicate is answered from the index, not a heap scan.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`sql`,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:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` count`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` posts`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WHERE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` body `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'juicy'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`highlight`,children:`Highlight`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`tin.highlight`}),` adds markers around the text that produced the match. A match on `,_jsx(_components.code,{children:`apple`}),` returns `,_jsx(_components.code,{children:`'\u003cb>apple\u003c/b>'`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,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:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` id, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`tin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`highlight`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(body)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` posts`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WHERE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` body `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'apple'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`LIMIT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 20`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`tin.highlight`}),` is configurable, pass in additional arguments to customize the markers and perform the search.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`sql`,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:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` tin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`highlight`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(body, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'\u003cmark>'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'\u003c/mark>'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'apple'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` posts`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WHERE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`search-across-columns`,children:`Search across columns`}),`\n`,_jsxs(_components.p,{children:[`Each TIN index covers one text column. Index every column you want to search, then combine `,_jsx(_components.code,{children:`==>`}),` in SQL. `,_jsx(_components.code,{children:`tin.score(ctid)`}),` combines BM25 relevance across those fields for the row. To weight one column higher than another, use TINQL boost (`,_jsx(_components.code,{children:`^N`}),`) on that field’s query.`]}),`\n`,_jsxs(_components.p,{children:[`For example, `,_jsx(_components.code,{children:`name ==> 'fuji^1.5'`}),` makes a `,_jsx(_components.code,{children:`name`}),` match count 1.5 times an unboosted `,_jsx(_components.code,{children:`notes`}),` match.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`sql`,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:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CREATE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` TABLE`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fruits`}),_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\":`#D4D4D4`},children:` id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`bigint`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` PRIMARY KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` text`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` NOT NULL`}),_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\":`#D4D4D4`},children:` notes `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`text`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` NOT NULL`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CREATE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` INDEX`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fruits_name_tin`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fruits `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`USING`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tin (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CREATE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` INDEX`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fruits_notes_tin`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fruits `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`USING`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tin (notes);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` id, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`tin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`score`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(ctid) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`AS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` score, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, notes`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fruits`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WHERE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ==>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'fuji^1.5'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` AND`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` notes `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'citrus'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ORDER BY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` score `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`DESC`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`LIMIT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`local-development-and-ci`,children:`Local development and CI`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`https://github.com/planetscale/lead`,children:`Lead`}),` is a Postgres extension for exercising TIN-compatible application SQL in local development and CI. It uses the `,_jsx(_components.code,{children:`tin`}),` extension name so you can test your application’s search queries without connecting to PlanetScale.`]}),`\n`,_jsxs(_components.p,{children:[`Lead supports Postgres 17 and 18 and is built from source. Follow the `,_jsx(_components.a,{href:`https://github.com/planetscale/lead#build`,children:`Lead README`}),` for build prerequisites, local setup, and packaging instructions for your test database.`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Lead is intended for small development and test datasets. It scans table rows instead of maintaining TIN’s search index, so it is not suitable for production workloads or benchmarking TIN’s performance. Use TIN on PlanetScale for production search.`})}),`\n`,_jsx(Heading,{level:`2`,id:`common-pitfalls`,children:`Common pitfalls`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Symptom`}),_jsx(_components.th,{children:`Fix`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Parse error on `,_jsx(_components.code,{children:`==>`})]}),_jsxs(_components.td,{children:[`Fix TINQL syntax. Keywords must be UPPERCASE (`,_jsx(_components.code,{children:`AND`}),`, not `,_jsx(_components.code,{children:`and`}),` as an operator). Explicit empty syntax (`,_jsx(_components.code,{children:`\"\"`}),`, `,_jsx(_components.code,{children:`[]`}),`) is a parse error.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Zero rows`}),_jsxs(_components.td,{children:[`Broaden the query (`,_jsx(_components.code,{children:`OR`}),`, fewer required terms, wildcards). Confirm you indexed the column you are searching. Check tokenization with `,_jsx(_components.code,{children:`tin.tokenize`}),`. Inputs that analyze to no tokens (`,_jsx(_components.code,{children:`''`}),`, whitespace, bare punctuation) match nothing.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Score / max_score error`}),_jsxs(_components.td,{children:[`Call `,_jsx(_components.code,{children:`tin.score(ctid)`}),` / `,_jsx(_components.code,{children:`tin.max_score(ctid)`}),` on a query that also has `,_jsx(_components.code,{children:`col ==> …`}),`. They require a TIN index scan and error in other contexts (including DML `,_jsx(_components.code,{children:`RETURNING`}),` without a scan). On a `,_jsx(_components.strong,{children:`partitioned parent`}),`, every planned leaf needs a usable TIN index — see `,_jsx(_components.a,{href:`/postgres/search/reference/limitations`,children:`limitations`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Exclusion not working`}),_jsxs(_components.td,{children:[`Use `,_jsx(_components.code,{children:`AND NOT`}),`, not `,_jsx(_components.code,{children:`-term`}),`. `,_jsx(_components.code,{children:`-`}),` is not negation.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`MATCHES`}),` finds nothing`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`MATCHES`}),` is not folded. Match the dictionary form (usually lowercase, accents folded): `,_jsx(_components.code,{children:`MATCHES apple.*`}),`, not `,_jsx(_components.code,{children:`MATCHES Apple.*`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Accent / case mismatch`}),_jsxs(_components.td,{children:[`Defaults fold both. Search `,_jsx(_components.code,{children:`jalapeno`}),` to match `,_jsx(_components.code,{children:`Jalapeño`}),`. Override with `,_jsx(_components.code,{children:`WITH (case_folding = preserve, accent_folding = preserve)`}),` if you need exact surface forms.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Inflected forms miss`}),_jsxs(_components.td,{children:[`Stemming is off by default. Create the index `,_jsx(_components.code,{children:`WITH (stemmer = 'en')`}),` (or another `,_jsx(_components.a,{href:`/postgres/search/reference/indexes#stemming`,children:`language code`}),`), then `,_jsx(_components.code,{children:`REINDEX`}),` if the index already has rows.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Fuzzy error on hyphenated term`}),_jsxs(_components.td,{children:[`Fuzzy needs one token after tokenization. Prefer `,_jsx(_components.code,{children:`wi-fi`}),` as a phrase (`,_jsx(_components.code,{children:`\"wi fi\"`}),`) or drop `,_jsx(_components.code,{children:`~N`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Fuzzy `,_jsx(_components.code,{children:`~1`}),` misses common typos`]}),_jsxs(_components.td,{children:[`Start with `,_jsx(_components.code,{children:`term~2`}),`. `,_jsx(_components.code,{children:`term~1`}),` locks the first character and treats adjacent letter swaps as two edits. Use `,_jsx(_components.code,{children:`term~0:N`}),` to allow a first-character change.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Out-of-range `,_jsx(_components.code,{children:`k1`}),` / `,_jsx(_components.code,{children:`b`}),` / boost`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`k1`}),` and query boosts must be in `,_jsx(_components.code,{children:`[0.0..10000.0]`}),`; `,_jsx(_components.code,{children:`b`}),` must be in `,_jsx(_components.code,{children:`[0.0..1.0]`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Index keeps growing`}),_jsxs(_components.td,{children:[`The index relation grows to a high-water mark and does not shrink on its own. `,_jsx(_components.code,{children:`REINDEX`}),` shrinks it. See `,_jsx(_components.a,{href:`/postgres/search/reference/limitations`,children:`limitations`}),`.`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`need-help`,children:`Need help?`}),`\n`,_jsxs(_components.p,{children:[`Get help from `,_jsx(_components.a,{href:`https://planetscale.com/contact?initial=support`,children:`the PlanetScale Support team`}),`, or join our\\xA0`,_jsx(_components.a,{href:`https://pscale.link/community`,children:`Discord community`}),` to see how others are using PlanetScale.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{__snippet_platformLabels_3vlljw,__snippet_combinedPlatformLabels_3vlljw,__snippet_platformBadgeClassName_3vlljw,__snippet_docsHref_3vlljw,__snippet_PlatformAvailabilityBadges_3vlljw,__snippet_PlatformAvailabilityText_3vlljw,PlatformAvailability,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":"Get started with TIN","sidebarTitle":"Get started","description":"Install the `tin` extension, create a TIN index, and run TINQL queries with BM25 ranking.","og:image":"images/og/postgres/search/get-started.png","href":"/postgres/search/get-started"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[166,14628,"undefined;const __snippet_combinedPlatformLabels_3vlljw=undefined;const __snippet_platformBadgeClassName_3vlljw=undefined;const __snippet_docsHref_3vlljw=()=>null;const __snippet_PlatformAvailabilityBadges_3vlljw=()=>null;const __snippet_PlatformAvailabilityText_3vlljw=()=>null;const PlatformAvailability=()=>null;funct"]]},"mdxExtracts":{"tableOfContents":[{"title":"Install the extension","slug":"install-the-extension","depth":2,"children":[{"title":"Upgrade the extension","slug":"upgrade-the-extension","depth":3,"children":[]}]},{"title":"Create a table and index","slug":"create-a-table-and-index","depth":2,"children":[]},{"title":"Your first queries","slug":"your-first-queries","depth":2,"children":[{"title":"Filter","slug":"filter","depth":3,"children":[]},{"title":"Ranked results (BM25)","slug":"ranked-results-bm25","depth":3,"children":[]},{"title":"Count","slug":"count","depth":3,"children":[]},{"title":"Highlight","slug":"highlight","depth":3,"children":[]},{"title":"Search across columns","slug":"search-across-columns","depth":3,"children":[]}]},{"title":"Local development and CI","slug":"local-development-and-ci","depth":2,"children":[]},{"title":"Common pitfalls","slug":"common-pitfalls","depth":2,"children":[]},{"title":"Need help?","slug":"need-help","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/planetscale-2/b155242ec3c4945e/custom.js"],"dynamicCss":".mint-mb-5 {\n margin-bottom: 1.25rem\n}\n.mint-flex {\n display: flex\n}\n.mint-inline-flex {\n display: inline-flex\n}\n.mint-shrink-0 {\n flex-shrink: 0\n}\n.mint-flex-wrap {\n flex-wrap: wrap\n}\n.mint-items-center {\n align-items: center\n}\n.mint-gap-1\\.5 {\n gap: 0.375rem\n}\n.mint-gap-2 {\n gap: 0.5rem\n}\n.mint-whitespace-nowrap {\n white-space: nowrap\n}\n.mint-rounded-full {\n border-radius: 9999px\n}\n.mint-border {\n border-width: 1px\n}\n.mint-px-2\\.5 {\n padding-left: 0.625rem;\n padding-right: 0.625rem\n}\n.mint-py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem\n}\n.mint-text-\\[13px\\] {\n font-size: 13px\n}\n.mint-font-semibold {\n font-weight: 600\n}\n.mint-leading-tight {\n line-height: 1.25\n}\n.mint-no-underline {\n text-decoration-line: none\n}\n.data-\\[engine\\=both\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#d4d4d4\\][data-state=\"current\"][data-engine=\"both\"] {\n --tw-border-opacity: 1;\n border-color: rgb(212 212 212 / var(--tw-border-opacity, 1))\n}\n.data-\\[engine\\=neki\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#fbca00\\][data-state=\"current\"][data-engine=\"neki\"] {\n --tw-border-opacity: 1;\n border-color: rgb(251 202 0 / var(--tw-border-opacity, 1))\n}\n.data-\\[engine\\=neki\\]\\:data-\\[state\\=link\\]\\:mint-border-\\[\\#fbca00\\][data-state=\"link\"][data-engine=\"neki\"] {\n --tw-border-opacity: 1;\n border-color: rgb(251 202 0 / var(--tw-border-opacity, 1))\n}\n.data-\\[engine\\=postgres\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#a9dffe\\][data-state=\"current\"][data-engine=\"postgres\"] {\n --tw-border-opacity: 1;\n border-color: rgb(169 223 254 / var(--tw-border-opacity, 1))\n}\n.data-\\[engine\\=postgres\\]\\:data-\\[state\\=link\\]\\:mint-border-\\[\\#a9dffe\\][data-state=\"link\"][data-engine=\"postgres\"] {\n --tw-border-opacity: 1;\n border-color: rgb(169 223 254 / var(--tw-border-opacity, 1))\n}\n.data-\\[engine\\=vitess\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#ffc59b\\][data-state=\"current\"][data-engine=\"vitess\"] {\n --tw-border-opacity: 1;\n border-color: rgb(255 197 155 / var(--tw-border-opacity, 1))\n}\n.data-\\[engine\\=vitess\\]\\:data-\\[state\\=link\\]\\:mint-border-\\[\\#ffc59b\\][data-state=\"link\"][data-engine=\"vitess\"] {\n --tw-border-opacity: 1;\n border-color: rgb(255 197 155 / var(--tw-border-opacity, 1))\n}\n.data-\\[engine\\=both\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#f0f0f0\\][data-state=\"current\"][data-engine=\"both\"] {\n --tw-bg-opacity: 1;\n background-color: rgb(240 240 240 / var(--tw-bg-opacity, 1))\n}\n.data-\\[engine\\=neki\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#fbca00\\][data-state=\"current\"][data-engine=\"neki\"] {\n --tw-bg-opacity: 1;\n background-color: rgb(251 202 0 / var(--tw-bg-opacity, 1))\n}\n.data-\\[engine\\=neki\\]\\:data-\\[state\\=link\\]\\:mint-bg-transparent[data-state=\"link\"][data-engine=\"neki\"] {\n background-color: transparent\n}\n.data-\\[engine\\=postgres\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#ddf2ff\\][data-state=\"current\"][data-engine=\"postgres\"] {\n --tw-bg-opacity: 1;\n background-color: rgb(221 242 255 / var(--tw-bg-opacity, 1))\n}\n.data-\\[engine\\=postgres\\]\\:data-\\[state\\=link\\]\\:mint-bg-transparent[data-state=\"link\"][data-engine=\"postgres\"] {\n background-color: transparent\n}\n.data-\\[engine\\=vitess\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#ffe8d8\\][data-state=\"current\"][data-engine=\"vitess\"] {\n --tw-bg-opacity: 1;\n background-color: rgb(255 232 216 / var(--tw-bg-opacity, 1))\n}\n.data-\\[engine\\=vitess\\]\\:data-\\[state\\=link\\]\\:mint-bg-transparent[data-state=\"link\"][data-engine=\"vitess\"] {\n background-color: transparent\n}\n.data-\\[engine\\=both\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#3d3d3d\\][data-state=\"current\"][data-engine=\"both\"] {\n --tw-text-opacity: 1;\n color: rgb(61 61 61 / var(--tw-text-opacity, 1))\n}\n.data-\\[engine\\=neki\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#1a1a1a\\][data-state=\"current\"][data-engine=\"neki\"] {\n --tw-text-opacity: 1;\n color: rgb(26 26 26 / var(--tw-text-opacity, 1))\n}\n.data-\\[engine\\=neki\\]\\:data-\\[state\\=link\\]\\:mint-text-\\[\\#8f7200\\][data-state=\"link\"][data-engine=\"neki\"] {\n --tw-text-opacity: 1;\n color: rgb(143 114 0 / var(--tw-text-opacity, 1))\n}\n.data-\\[engine\\=postgres\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#0e3682\\][data-state=\"current\"][data-engine=\"postgres\"] {\n --tw-text-opacity: 1;\n color: rgb(14 54 130 / var(--tw-text-opacity, 1))\n}\n.data-\\[engine\\=postgres\\]\\:data-\\[state\\=link\\]\\:mint-text-\\[\\#0b6ec5\\][data-state=\"link\"][data-engine=\"postgres\"] {\n --tw-text-opacity: 1;\n color: rgb(11 110 197 / var(--tw-text-opacity, 1))\n}\n.data-\\[engine\\=vitess\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#672002\\][data-state=\"current\"][data-engine=\"vitess\"] {\n --tw-text-opacity: 1;\n color: rgb(103 32 2 / var(--tw-text-opacity, 1))\n}\n.data-\\[engine\\=vitess\\]\\:data-\\[state\\=link\\]\\:mint-text-\\[\\#b83a05\\][data-state=\"link\"][data-engine=\"vitess\"] {\n --tw-text-opacity: 1;\n color: rgb(184 58 5 / var(--tw-text-opacity, 1))\n}\n.dark\\:data-\\[engine\\=both\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#525252\\][data-state=\"current\"][data-engine=\"both\"]:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(82 82 82 / var(--tw-border-opacity, 1))\n}\n.dark\\:data-\\[engine\\=neki\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#fbca00\\][data-state=\"current\"][data-engine=\"neki\"]:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(251 202 0 / var(--tw-border-opacity, 1))\n}\n.dark\\:data-\\[engine\\=neki\\]\\:data-\\[state\\=link\\]\\:mint-border-\\[\\#fbca00\\][data-state=\"link\"][data-engine=\"neki\"]:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(251 202 0 / var(--tw-border-opacity, 1))\n}\n.dark\\:data-\\[engine\\=postgres\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#144eb6\\][data-state=\"current\"][data-engine=\"postgres\"]:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(20 78 182 / var(--tw-border-opacity, 1))\n}\n.dark\\:data-\\[engine\\=postgres\\]\\:data-\\[state\\=link\\]\\:mint-border-\\[\\#144eb6\\][data-state=\"link\"][data-engine=\"postgres\"]:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(20 78 182 / var(--tw-border-opacity, 1))\n}\n.dark\\:data-\\[engine\\=vitess\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#962d00\\][data-state=\"current\"][data-engine=\"vitess\"]:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(150 45 0 / var(--tw-border-opacity, 1))\n}\n.dark\\:data-\\[engine\\=vitess\\]\\:data-\\[state\\=link\\]\\:mint-border-\\[\\#962d00\\][data-state=\"link\"][data-engine=\"vitess\"]:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(150 45 0 / var(--tw-border-opacity, 1))\n}\n.dark\\:data-\\[engine\\=both\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#2a2a2a\\][data-state=\"current\"][data-engine=\"both\"]:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(42 42 42 / var(--tw-bg-opacity, 1))\n}\n.dark\\:data-\\[engine\\=neki\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#fbca00\\][data-state=\"current\"][data-engine=\"neki\"]:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(251 202 0 / var(--tw-bg-opacity, 1))\n}\n.dark\\:data-\\[engine\\=neki\\]\\:data-\\[state\\=link\\]\\:mint-bg-transparent[data-state=\"link\"][data-engine=\"neki\"]:is(.dark *) {\n background-color: transparent\n}\n.dark\\:data-\\[engine\\=postgres\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#08204e\\][data-state=\"current\"][data-engine=\"postgres\"]:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(8 32 78 / var(--tw-bg-opacity, 1))\n}\n.dark\\:data-\\[engine\\=postgres\\]\\:data-\\[state\\=link\\]\\:mint-bg-transparent[data-state=\"link\"][data-engine=\"postgres\"]:is(.dark *) {\n background-color: transparent\n}\n.dark\\:data-\\[engine\\=vitess\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#3c1403\\][data-state=\"current\"][data-engine=\"vitess\"]:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(60 20 3 / var(--tw-bg-opacity, 1))\n}\n.dark\\:data-\\[engine\\=vitess\\]\\:data-\\[state\\=link\\]\\:mint-bg-transparent[data-state=\"link\"][data-engine=\"vitess\"]:is(.dark *) {\n background-color: transparent\n}\n.dark\\:data-\\[engine\\=both\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#e5e5e5\\][data-state=\"current\"][data-engine=\"both\"]:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(229 229 229 / var(--tw-text-opacity, 1))\n}\n.dark\\:data-\\[engine\\=neki\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#1a1a1a\\][data-state=\"current\"][data-engine=\"neki\"]:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(26 26 26 / var(--tw-text-opacity, 1))\n}\n.dark\\:data-\\[engine\\=neki\\]\\:data-\\[state\\=link\\]\\:mint-text-\\[\\#fbca00\\][data-state=\"link\"][data-engine=\"neki\"]:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(251 202 0 / var(--tw-text-opacity, 1))\n}\n.dark\\:data-\\[engine\\=postgres\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#ddf2ff\\][data-state=\"current\"][data-engine=\"postgres\"]:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(221 242 255 / var(--tw-text-opacity, 1))\n}\n.dark\\:data-\\[engine\\=postgres\\]\\:data-\\[state\\=link\\]\\:mint-text-\\[\\#73c7f9\\][data-state=\"link\"][data-engine=\"postgres\"]:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(115 199 249 / var(--tw-text-opacity, 1))\n}\n.dark\\:data-\\[engine\\=vitess\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#ffe8d8\\][data-state=\"current\"][data-engine=\"vitess\"]:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(255 232 216 / var(--tw-text-opacity, 1))\n}\n.dark\\:data-\\[engine\\=vitess\\]\\:data-\\[state\\=link\\]\\:mint-text-\\[\\#ffc59b\\][data-state=\"link\"][data-engine=\"vitess\"]:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(255 197 155 / var(--tw-text-opacity, 1))\n}","subdomain":"planetscale-2","siteName":"PlanetScale","title":"Get started with TIN - PlanetScale","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-26T19:25:28.951Z","originalFileLocation":"postgres/search/get-started.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=\"description\" content=\"Install the tin extension, create a TIN index, and run TINQL queries with BM25 ranking.\">\u003cmeta data-mint-head name=\"application-name\" content=\"PlanetScale\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_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=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Get started with TIN - PlanetScale\">\u003cmeta data-mint-head property=\"og:description\" content=\"Install the tin extension, create a TIN index, and run TINQL queries with BM25 ranking.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"PlanetScale\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://planetscale.com/docs/postgres/search/get-started\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://planetscale-2.mintlify.app/images/og/postgres/search/get-started.png\">\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=\"Get started with TIN - PlanetScale\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Install the tin extension, create a TIN index, and run TINQL queries with BM25 ranking.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://planetscale-2.mintlify.app/images/og/postgres/search/get-started.png\">\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=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"PlanetScale\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0e73cc\">\u003clink data-mint-head rel=\"canonical\" href=\"https://planetscale.com/docs/postgres/search/get-started\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/postgres/search/get-started.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://planetscale.com/#organization\",\"name\":\"PlanetScale\",\"url\":\"https://planetscale.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/planetscale-2/xUilVHToUFALai8a/logo/light.png?fit=max\u0026auto=format\u0026n=xUilVHToUFALai8a\u0026q=85\u0026s=cccd3c9fc813c01b899ab7af15a115b1\"}},{\"@type\":\"WebSite\",\"@id\":\"https://planetscale.com/docs#website\",\"name\":\"PlanetScale\",\"url\":\"https://planetscale.com/docs\",\"publisher\":{\"@id\":\"https://planetscale.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://planetscale.com/docs/postgres/search/get-started#webpage\",\"url\":\"https://planetscale.com/docs/postgres/search/get-started\",\"name\":\"Get started with TIN\",\"description\":\"Install the tin extension, create a TIN index, and run TINQL queries with BM25 ranking.\",\"dateModified\":\"2026-10-26T19:25:28.951Z\",\"isPartOf\":{\"@id\":\"https://planetscale.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://planetscale.com/docs/postgres/search/get-started#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://planetscale.com/docs/postgres/search/get-started#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Platform\",\"item\":\"https://planetscale.com/docs/postgres/pricing\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Search (TIN)\",\"item\":\"https://planetscale.com/docs/postgres/search\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Get started with TIN\",\"item\":\"https://planetscale.com/docs/postgres/search/get-started\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://planetscale.com/docs/postgres/search/get-started#article\",\"headline\":\"Get started with TIN\",\"name\":\"Get started with TIN\",\"description\":\"Install the tin extension, create a TIN index, and run TINQL queries with BM25 ranking.\",\"url\":\"https://planetscale.com/docs/postgres/search/get-started\",\"mainEntityOfPage\":{\"@id\":\"https://planetscale.com/docs/postgres/search/get-started#webpage\"},\"image\":\"https://planetscale.com/docs/images/og/postgres/search/get-started.png\",\"dateModified\":\"2026-10-26T19:25:28.951Z\",\"publisher\":{\"@id\":\"https://planetscale.com/#organization\"},\"isPartOf\":{\"@id\":\"https://planetscale.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"PlanetScale\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"PlanetScale","nav":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://planetscale.com/blog"},{"anchor":"Contact Us","icon":"headset","href":"https://planetscale.com/contact"},{"anchor":"Status","icon":"signal","href":"https://www.planetscalestatus.com/"},{"anchor":"Benchmarks","icon":"chart-line","href":"https://planetscale.com/benchmarks"}]},"tabs":[{"tab":"Platform","pages":[{"title":"Platform","href":""}]},{"tab":"Vitess","pages":[{"title":"Vitess","href":"/vitess"}]},{"tab":"Neki","pages":[{"title":"Neki","href":"/neki"}]},{"tab":"Postgres","groups":[{"group":"Onboarding","pages":[{"title":"PlanetScale Postgres","sidebarTitle":"Welcome","href":"/postgres"},{"group":"Getting started","pages":[{"title":"PlanetScale Postgres quickstart","sidebarTitle":"Quickstart","href":"/postgres/tutorials/planetscale-postgres-quickstart"},{"title":"Day one with PlanetScale Postgres","sidebarTitle":"Next steps","href":"/postgres/day-one-with-planetscale-postgres"},{"title":"PlanetScale Postgres database dashboard","sidebarTitle":"Dashboard overview","href":"/postgres/dashboard"},{"title":"Web console","sidebarTitle":"Web console","href":"/postgres/web-console"},{"title":"PlanetScale Postgres architecture","sidebarTitle":"Postgres architecture","href":"/postgres/postgres-architecture"},{"title":"Postgres compatibility","href":"/postgres/postgres-compatibility"},{"title":"PlanetScale Postgres operations philosophy","sidebarTitle":"Operations philosophy","href":"/postgres/operations-philosophy"},{"title":"Connection resilience guide","sidebarTitle":"Connection resilience","href":"/postgres/connection-resilience"}]}]},{"group":"Platform","pages":[{"title":"PlanetScale Postgres pricing","sidebarTitle":"Pricing","href":"/postgres/pricing"},{"group":"Configuration","pages":[{"title":"Cluster configuration","sidebarTitle":"Cluster configuration","href":"/postgres/cluster-configuration"},{"title":"CPU Architectures","sidebarTitle":"CPU architecture","href":"/postgres/cluster-configuration/cpu-architectures"},{"title":"Cluster storage configuration","sidebarTitle":"Disk Storage","href":"/postgres/cluster-configuration/cluster-storage"},{"title":"Maintenance windows","href":"/postgres/cluster-configuration/maintenance-windows"},{"title":"Cluster configuration parameters","sidebarTitle":"Parameters","href":"/postgres/cluster-configuration/parameters"},{"title":"Disk autoscaling","href":"/postgres/cluster-configuration/disk-autoscaling"},{"title":"Single node","href":"/postgres/cluster-configuration/single-node"},{"title":"Supported versions","sidebarTitle":"Versions","href":"/postgres/cluster-configuration/versions"},{"title":"Cluster updates","href":"/postgres/cluster-configuration/updates"},{"title":"Settings","sidebarTitle":"Database settings","href":"/postgres/settings"}]},{"group":"Extensions","pages":[{"title":"Extensions","sidebarTitle":"Overview","href":"/postgres/extensions"},{"title":"Extensions: auto_explain","sidebarTitle":"auto_explain","href":"/postgres/extensions/auto_explain"},{"title":"Extensions: pg_cron","sidebarTitle":"pg_cron","href":"/postgres/extensions/pg_cron"},{"title":"Extensions: pg_hint_plan","sidebarTitle":"pg_hint_plan","href":"/postgres/extensions/pg_hint_plan"},{"title":"Extensions: pg_partman_bgw","sidebarTitle":"pg_partman_bgw","href":"/postgres/extensions/pg_partman_bgw"},{"title":"Extensions: pg_squeeze","sidebarTitle":"pg_squeeze","href":"/postgres/extensions/pg_squeeze"},{"title":"Extensions: pg_stat_statements","sidebarTitle":"pg_stat_statements","href":"/postgres/extensions/pg_stat_statements"},{"title":"Extensions: pg_strict","sidebarTitle":"pg_strict","href":"/postgres/extensions/pg_strict"},{"title":"Extensions: pginsights","sidebarTitle":"pginsights","href":"/postgres/extensions/pginsights"},{"title":"Extensions: pg_duckdb","sidebarTitle":"pg_duckdb","href":"/postgres/extensions/pg_duckdb"},{"title":"Extensions: pgvector","sidebarTitle":"pgvector","href":"/postgres/extensions/pgvector"},{"title":"Extensions: TimescaleDB","sidebarTitle":"TimescaleDB","href":"/postgres/extensions/timescaledb"}]},{"group":"Connecting","pages":[{"title":"Connections overview","sidebarTitle":"Overview","href":"/postgres/connecting"},{"title":"Connections quickstart","sidebarTitle":"Quickstart","href":"/postgres/connecting/quickstart"},{"title":"Managing Roles for your Postgres database","sidebarTitle":"Role management","href":"/postgres/connecting/roles"},{"title":"PgBouncer","href":"/postgres/connecting/pgbouncer"},{"title":"PostgreSQL Proxy - Client Error Reference","sidebarTitle":"Proxy error reference","href":"/postgres/connecting/client-error-reference"},{"title":"Using the Neon serverless driver","sidebarTitle":"Neon serverless driver","href":"/postgres/connecting/neon-serverless-driver"},{"title":"IP restrictions","sidebarTitle":"IP restrictions","href":"/postgres/connecting/ip-restrictions"},{"group":"MCP","pages":[{"title":"PlanetScale Model Context Protocol (MCP)","sidebarTitle":"Overview","href":"/mcp-server"},{"title":"Authenticate the MCP server with a service token","sidebarTitle":"Service tokens","href":"/mcp/service-token"}]},{"title":"Self-improving database","sidebarTitle":"Self-improving database","href":"/self-improving-database"},{"title":"PlanetScale Terraform provider","sidebarTitle":"Terraform provider","href":"/terraform"},{"group":"Private connections","pages":[{"title":"Connect privately with AWS PrivateLink","sidebarTitle":"AWS PrivateLink","href":"/postgres/connecting/private-connections/aws-privatelink"},{"title":"Connect privately with GCP Private Service Connect","sidebarTitle":"GCP Private Service Connect","href":"/postgres/connecting/private-connections/gcp-private-service-connect"}]}]},{"group":"Imports","pages":[{"title":"Postgres Imports","sidebarTitle":"Postgres import overview","href":"/postgres/imports/postgres-imports"},{"title":"Discovery Tool","sidebarTitle":"Discovery tool","href":"/postgres/imports/discovery-tool"},{"title":"Postgres Imports - Cloudflare D1","sidebarTitle":"Import from Cloudflare D1","href":"/postgres/imports/postgres-migrate-d1"},{"title":"Postgres Imports - PGDump and Restore","sidebarTitle":"Import with dump/restore","href":"/postgres/imports/postgres-migrate-dumprestore"},{"title":"Postgres Imports - WAL Streaming","sidebarTitle":"Import with WAL streaming","href":"/postgres/imports/postgres-migrate-walstream"},{"title":"Postgres Imports - pgcopydb","sidebarTitle":"Import with pgcopydb","href":"/postgres/imports/postgres-migrate-pgcopydb"},{"title":"Postgres Imports - Amazon DMS","sidebarTitle":"Import with DMS","href":"/postgres/imports/postgres-migrate-dms"},{"title":"Import public IP addresses","href":"/postgres/imports/import-ips"},{"group":"Provider-specific guides","pages":[{"title":"Migrate from Supabase to PlanetScale","sidebarTitle":"Import from Supabase","href":"/postgres/imports/supabase"},{"title":"Migrate from Neon to PlanetScale","sidebarTitle":"Import from Neon","href":"/postgres/imports/neon"},{"title":"Migrate from Heroku to PlanetScale","sidebarTitle":"Import from Heroku","href":"/postgres/imports/heroku"},{"title":"Migrate from Aurora to PlanetScale","sidebarTitle":"Import from Aurora","href":"/postgres/imports/aurora"},{"title":"Migrate from Aurora using Amazon DMS with CloudFormation","sidebarTitle":"Import from Aurora using DMS","href":"/postgres/imports/aurora-dms"}]}]},{"group":"Branching","pages":[{"title":"Branching","sidebarTitle":"Overview","href":"/postgres/branching"},{"title":"Development Environments","sidebarTitle":"Development environments","href":"/postgres/development-environments"}]},{"group":"Integrations","pages":[{"title":"PlanetScale GitHub Actions","sidebarTitle":"Automating with GitHub Actions","href":"/postgres/integrations/github-actions"},{"title":"Logical replication and Change Data Capture (CDC)","sidebarTitle":"Logical replication and Change Data Capture (CDC)","href":"/postgres/integrations/logical-cdc"}]},{"group":"Monitoring","pages":[{"title":"Query Insights","href":"/postgres/monitoring/query-insights"},{"title":"Inspect live Postgres connections","sidebarTitle":"Connections","href":"/postgres/monitoring/connections"},{"title":"Tags","href":"/postgres/monitoring/query-tags"},{"title":"Cluster Metrics","sidebarTitle":"Metrics","href":"/postgres/monitoring/metrics"},{"title":"Cluster Logs","sidebarTitle":"Logs","href":"/postgres/monitoring/logs"},{"title":"Authentication attempts","sidebarTitle":"Authentication attempts","href":"/postgres/monitoring/authentication-attempts"},{"title":"Anomalies","href":"/postgres/monitoring/anomalies"},{"title":"Errors","sidebarTitle":"Errors","href":"/postgres/monitoring/errors"},{"title":"Schema recommendations","href":"/postgres/monitoring/schema-recommendations"},{"group":"Integrations","pages":[{"title":"Prometheus integration for PlanetScale Postgres","sidebarTitle":"Prometheus integration","href":"/postgres/monitoring/prometheus-postgres"},{"title":"Prometheus metrics for PlanetScale Postgres","sidebarTitle":"Prometheus metrics reference","href":"/postgres/monitoring/prometheus-metrics-postgres"},{"title":"Sending Prometheus Metrics to Datadog for PlanetScale Postgres","sidebarTitle":"Datadog integration","href":"/postgres/monitoring/prometheus-metrics-datadog-postgres"},{"title":"pganalyze collector","sidebarTitle":"pganalyze collector","href":"/postgres/monitoring/pganalyze"}]}]},{"group":"Troubleshooting","pages":[{"title":"Read-only mode","href":"/postgres/troubleshooting/read-only-mode"},{"title":"Out of memory (OOM)","href":"/postgres/troubleshooting/out-of-memory"},{"title":"Switchovers","sidebarTitle":"Switchovers","href":"/postgres/troubleshooting/switchovers"}]},{"group":"Backups","pages":[{"title":"Back up and restore","href":"/postgres/backups"},{"title":"Point-in-time recovery","href":"/postgres/backups/point-in-time-recovery"}]},{"group":"Scaling","pages":[{"title":"Database replicas","sidebarTitle":"Replicas","href":"/postgres/scaling/replicas"},{"title":"Dedicated read replicas","sidebarTitle":"Dedicated read replicas","href":"/postgres/scaling/dedicated-read-replicas"},{"title":"Horizontal sharding for Postgres","sidebarTitle":"Sharding","href":"/postgres/sharding"}]},{"group":"Search (TIN)","pages":[{"title":"TIN: PlanetScale Postgres Search","sidebarTitle":"Overview","description":"A fully featured and fast search engine inside Postgres","href":"/postgres/search"},{"title":"Get started with TIN","sidebarTitle":"Get started","href":"/postgres/search/get-started"},{"title":"TINQL","description":"A fully-featured query language unique to TIN.","href":"/postgres/search/tinql"},{"title":"Scoring","href":"/postgres/search/scoring"},{"title":"Highlighting","sidebarTitle":"Highlighting","href":"/postgres/search/highlighting"},{"title":"Operational guidance","sidebarTitle":"Operations","href":"/postgres/search/operations"},{"group":"Reference","pages":[{"title":"Indexes","sidebarTitle":"Indexes","href":"/postgres/search/reference/indexes"},{"title":"The ==> operator","sidebarTitle":"Operator","href":"/postgres/search/reference/operator"},{"title":"Functions","sidebarTitle":"Functions","href":"/postgres/search/reference/functions"},{"title":"Recommended SQL shapes","sidebarTitle":"SQL shapes","href":"/postgres/search/reference/sql-shapes"},{"title":"Limitations","sidebarTitle":"Limitations","href":"/postgres/search/reference/limitations"},{"title":"Settings","sidebarTitle":"Settings","href":"/postgres/search/reference/settings"}]}]},{"group":"Database Traffic Control™","pages":[{"title":"Database Traffic Control","sidebarTitle":"Overview","href":"/postgres/traffic-control"},{"title":"Concepts","href":"/postgres/traffic-control/concepts"},{"title":"Getting started","href":"/postgres/traffic-control/getting-started"},{"title":"Examples and recipes","href":"/postgres/traffic-control/examples-and-recipes"},{"title":"FAQ and troubleshooting","href":"/postgres/traffic-control/faq-and-troubleshooting"}]}]},{"group":"Guides","pages":[{"title":"PlanetScale Postgres with Drizzle","sidebarTitle":"Drizzle","href":"/postgres/tutorials/planetscale-postgres-drizzle"},{"title":"PlanetScale Postgres with Kysely","sidebarTitle":"Kysely","href":"/postgres/tutorials/planetscale-postgres-kysely"},{"title":"PlanetScale Postgres with Prisma","sidebarTitle":"Prisma","href":"/postgres/tutorials/planetscale-postgres-prisma"},{"title":"PlanetScale Postgres with Laravel","sidebarTitle":"Laravel","href":"/postgres/tutorials/planetscale-postgres-laravel"},{"title":"PlanetScale Postgres with Ruby on Rails","sidebarTitle":"Ruby on Rails","href":"/postgres/tutorials/planetscale-postgres-rails"},{"title":"PlanetScale Postgres with Cloudflare Workers","sidebarTitle":"Cloudflare Workers","href":"/postgres/tutorials/planetscale-postgres-cloudflare-workers"},{"title":"PlanetScale Postgres with Bun","sidebarTitle":"Bun","href":"/postgres/tutorials/planetscale-postgres-bun"},{"title":"PlanetScale Postgres with Node.js","sidebarTitle":"Node.js","href":"/postgres/tutorials/planetscale-postgres-node"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api/reference/getting-started-with-planetscale-api"}]},{"tab":"CLI Reference","pages":[{"title":"CLI Reference","href":"/cli"}]}]},"title":"Get started with TIN - PlanetScale","buildId":"dpl_3rfzHPCtRhDFBbetXZ3oLkN5tjmA","deploymentId":"dpl_3rfzHPCtRhDFBbetXZ3oLkN5tjmA","dynamics":[],"chunks":[]}