---
title: "Analyze query execution plan"
method: POST
path: "/v1/table/{id}/analyze_plan"
tags: ["Table", "Data"]
---

# Analyze query execution plan

`POST /v1/table/{id}/analyze_plan`

Analyze the query execution plan for a query against table `id`.
Returns detailed statistics and analysis of the query execution plan.

REST NAMESPACE ONLY
REST namespace returns the response as a plain string
instead of the `AnalyzeTableQueryPlanResponse` JSON object.

## Path parameters

- `id` string, required

## Query parameters

- `delimiter` string

## Request body

- AnalyzeTableQueryPlanRequest
  - `id` string[]
  - `bypass_vector_index` boolean — Whether to bypass vector index
  - `columns` QueryTableRequestColumns, nullable — Optional columns to return. Provide either column_names or column_aliases, not both.
    - `column_names` string[] — List of column names to return
    - `column_aliases` unknown
  - `distance_type` string — Distance metric to use
  - `ef` integer — Search effort parameter for HNSW index
  - `fast_search` boolean — Whether to use fast search
  - `filter` string — Optional SQL filter expression
  - `full_text_query` QueryTableRequestFullTextQuery, nullable — Optional full-text search query. Provide either string_query or structured_query, not both.
    - `string_query` StringFtsQuery
      - `columns` string[]
      - `query` string, required
    - `structured_query` StructuredFtsQuery
      - `query` FtsQuery, required — Full-text search query. Exactly one query type field must be provided. This structure follows the same pattern as AlterTransactionAction to minimize differences and compatibility issues across codegen in different languages.
        - `match` MatchQuery
          - `boost` number, float
          - `column` string
          - `fuzziness` integer
          - `max_expansions` integer — The maximum number of terms to expand for fuzzy matching. Default to 50.
          - `operator` string — The operator to use for combining terms. Case insensitive, supports both PascalCase and snake_case. Valid values are: - And: All terms must match. - Or: At least one term must match.
          - `prefix_length` integer — The number of beginning characters being unchanged for fuzzy matching. Default to 0.
          - `terms` string, required
        - `phrase` PhraseQuery
          - `column` string
          - `slop` integer
          - `terms` string, required
        - `boost` BoostQuery — Boost query that scores documents matching positive query higher and negative query lower
          - `positive` FtsQuery, required — recursive
          - `negative` FtsQuery, required — recursive
          - `negative_boost` number, float — Boost factor for negative query (default: 0.5)
        - `multi_match` MultiMatchQuery
          - `match_queries` MatchQuery[], required
            - `boost` number, float
            - `column` string
            - `fuzziness` integer
            - `max_expansions` integer — The maximum number of terms to expand for fuzzy matching. Default to 50.
            - `operator` string — The operator to use for combining terms. Case insensitive, supports both PascalCase and snake_case. Valid values are: - And: All terms must match. - Or: At least one term must match.
            - `prefix_length` integer — The number of beginning characters being unchanged for fuzzy matching. Default to 0.
            - `terms` string, required
        - `boolean` BooleanQuery — Boolean query with must, should, and must_not clauses
          - `must` FtsQuery[], required — Queries that must match (AND)
          - `must_not` FtsQuery[], required — Queries that must not match (NOT)
          - `should` FtsQuery[], required — Queries that should match (OR)
  - `k` integer, required — Number of results to return
  - `lower_bound` number, float — Lower bound for search
  - `nprobes` integer — Number of probes for IVF index
  - `offset` integer — Number of results to skip
  - `prefilter` boolean — Whether to apply filtering before vector search
  - `refine_factor` integer — Refine factor for search
  - `upper_bound` number, float — Upper bound for search
  - `vector` QueryTableRequestVector, nullable, required — Query vector(s) for similarity search. Provide either single_vector or multi_vector, not both.
    - `single_vector` number[] — Single query vector
    - `multi_vector` array[] — Multiple query vectors for batch search
      - number[]
  - `vector_column` string — Name of the vector column to search
  - `version` integer — Table version to query
  - `with_row_id` boolean — If true, return the row id as a column called `_rowid`

## Response `200`

Query execution plan analysis

- string — Human-readable query execution plan analysis

## Other responses

- `400` — Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware.
- `401` — Unauthorized. The request lacks valid authentication credentials for the operation.
- `403` — Forbidden. Authenticated user does not have the necessary permissions.
- `404` — A server-side problem that means can not find the specified resource.
- `503` — The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry.
- `5XX` — A server-side problem that might not be addressable from the client side. Used for server 5xx errors without more specific documentation in individual routes.

## Changes

- **2025-12-20** `5d6099d672d3` — 6 breaking, 6 warning, 6 info
  - the `code` response property's min was decreased from `400.00` to `0.00` for the response status `400`
  - the `code` response property's min was decreased from `400.00` to `0.00` for the response status `401`
  - the `code` response property's min was decreased from `400.00` to `0.00` for the response status `403`
  - the `code` response property's min was decreased from `400.00` to `0.00` for the response status `404`
  - …14 more
- **2025-12-11** `62ebe0595c5f` — 4 breaking
  - removed the enum value `And` of the request property `full_text_query/structured_query/query/match/operator`
  - removed the enum value `And` of the request property `full_text_query/structured_query/query/multi_match/match_queries/items/operator`
  - removed the enum value `Or` of the request property `full_text_query/structured_query/query/match/operator`
  - removed the enum value `Or` of the request property `full_text_query/structured_query/query/multi_match/match_queries/items/operator`
- **2025-12-11** `6ad4337e3849` — 4 breaking, 1 warning, 16 info
  - added the new required request property `k`
  - added the new required request property `vector`
  - the response's body type changed from no type to `string` for status `200`
  - removed the required property `analysis` from the response with the `200` status
  - …17 more
- **2025-08-02** `89fbd6272646` — 1 info
  - endpoint added
- …earlier changes not shown

[Full history](https://skmtc.dev/lance-format/apis/lance-namespace-specification/changes/v1/table/:id/analyze_plan/post.md)

---

[API](https://skmtc.dev/lance-format/apis/lance-namespace-specification.md) · [All operations](https://skmtc.dev/lance-format/apis/lance-namespace-specification/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/lance-format/lance-namespace-specification/revisions/5d6099d672d3/schema)
