This page summarizes the SQL-visible surface that matters for operating and benchmarking the extension.
USING turboquanttq_cosine_opstq_ip_opstq_l2_ops
tq_halfvec_cosine_opstq_halfvec_ip_opstq_halfvec_l2_ops
tq_bool_filter_opstq_int2_filter_opstq_int4_filter_opstq_int8_filter_opstq_date_filter_opstq_timestamptz_filter_opstq_uuid_filter_ops
Returns approximate candidates reranked exactly in SQL over the candidate set.
Typical call:
SELECT *
FROM tq_rerank_candidates(
'docs'::regclass,
'id',
'embedding',
'[1,0,0,0]'::vector(4),
'cosine',
50,
10
);Returns the approximate candidate set without exact reranking.
Returns recommended query settings for the requested candidate pool and final limit.
The helper keeps the SQL surface index-agnostic: it recommends probes and oversample_factor, then derives a generic max_visited_codes budget from the resolved oversampling so skewed IVF workloads can be costed and bounded by predicted visited work instead of raw probes / lists.
The current return columns are:
probesoversample_factormax_visited_codesmax_visited_pages
Bitmap-oriented helper used for filtered cosine workloads where ordered ANN scans are not the only plan shape.
Returns JSON metadata for a TurboQuant index, including:
- format version
- metric and opclass
- transform metadata
- router metadata
- live/dead counts
- page counts
- capability flags
- cheap heap estimate fields
Returns exact heap statistics for a TurboQuant index.
This helper is intentionally expensive. Use it when you want an exact heap row count and do not want that cost hidden behind the normal metadata API.
Runs lightweight TurboQuant maintenance and returns JSON counters for delta merge / compaction work.
Use this when you want to drain the built-in delta tier or apply lightweight maintenance without forcing a full REINDEX.
Returns the compiled and runtime-visible SIMD surface and selected score kernel.
Returns backend-local JSON for the most recent TurboQuant scan in the current session.
The current JSON includes:
Probe budget and scan work:
configured_probe_count,nominal_probe_count,effective_probe_countmax_visited_codes,max_visited_pagesselected_list_count,selected_live_count,selected_page_countvisited_page_count,visited_code_countcandidate_heap_capacity,candidate_heap_count,candidate_heap_insert_count,candidate_heap_reject_count,candidate_heap_replace_count
Scoring and pruning:
score_mode—code_domain(faithful fast path) ordecode_score(fallback)score_kernel—avx2,neon, orscalarscan_orchestration—ivf_bounded_pagesorivf_near_exhaustive(IVF only)page_bound_mode—safe_summary_pruningornonepage_prune_count,early_stop_countnear_exhaustive_crossover— boolean, whether scan crossed the near-exhaustive thresholddecoded_vector_count— zero on the faithful fast path
Returns backend-local shadow decode candidate CTIDs for the most recent TurboQuant scan in the current session.
This is an expert diagnostic used by the benchmark harness. The raw _core helper is not part of the public API.
- ordered ANN index scans
- ordered vector-key
Index Only Scanfor covered queries - bitmap support with explicit heap recheck semantics
- multicolumn TurboQuant indexes with fixed-width metadata attributes
INCLUDE-style fixed-width payload columns returned through index tuples
- internal heap reranking inside the access method
- varlena / text metadata predicates inside the ANN path