> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# vector_search_* session settings

> ClickHouse session settings in the vector_search_* generated group.

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>Type</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>Default</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          Changeable without restart
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

These settings are available in [system.settings](/docs/reference/system-tables/settings) and are autogenerated from [source](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp).

<h2 id="vector_search_filter_strategy">
  vector\_search\_filter\_strategy
</h2>

<SettingsInfoBlock type="VectorSearchFilterStrategy" default_value="auto" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.5"},{"label": "auto"},{"label": "New setting"}]}]} />

If a vector search query has a WHERE clause, this setting determines if it is evaluated first (pre-filtering) OR if the vector similarity index is checked first (post-filtering). Possible values:

* 'auto' - Postfiltering (the exact semantics may change in future).
* 'postfilter' - Use vector similarity index to identify the nearest neighbours, then apply other filters
* 'prefilter' - Evaluate other filters first, then perform brute-force search to identify neighbours.

<h2 id="vector_search_index_fetch_multiplier">
  vector\_search\_index\_fetch\_multiplier
</h2>

**Aliases**: `vector_search_postfilter_multiplier`

<SettingsInfoBlock type="Float" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.8"},{"label": "1"},{"label": "Alias for setting 'vector_search_postfilter_multiplier'"}]}]} />

Multiply the number of fetched nearest neighbors from the vector similarity index by this number. Only applied for post-filtering with other predicates or if setting 'vector\_search\_with\_rescoring = 1'. Valid range: \[1.0, 1000.0]. Values outside this range are rejected.

<h2 id="vector_search_use_quantized_codes">
  vector\_search\_use\_quantized\_codes
</h2>

<SettingsInfoBlock type="Bool" default_value="0" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.7"},{"label": "0"},{"label": "New setting to opt into the two-stage approximate vector-search optimization over a Quantize(...) column codec; queries stay exact by default."}]}]} />

Enables a two-stage approximate vector search without index (brute force scan) over a `Quantized`-compressed column. When enabled, `ORDER BY L2Distance|cosineDistance(vec, reference) LIMIT k` against a column encoded with a `Quantized(...)` codec will

1. scan and filter the quantized vectors (this step produces `k * vector_search_index_fetch_multiplier` results), and
2. rescore the found vectors against original, full-precision vectors.

<h2 id="vector_search_with_rescoring">
  vector\_search\_with\_rescoring
</h2>

<SettingsInfoBlock type="Bool" default_value="0" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.8"},{"label": "0"},{"label": "New setting."}]}]} />

If ClickHouse performs rescoring for queries that use the vector similarity index.
Without rescoring, the vector similarity index returns the rows containing the best matches directly.
With rescoring, the vector similarity index fetches candidate rows and ClickHouse computes the exact distance
for these rows from the original full-precision vectors in the regular SQL pipeline.
When possible, ClickHouse filters the scan to candidate rows before the final distance computation.
Increase `vector_search_index_fetch_multiplier` if more candidate rows are needed for better recall, especially
with additional filters or quantized vector indexes.
Note: A query run without rescoring and with parallel replicas enabled may fall back to rescoring.
