---
title: "We built a vector search engine that lets you choose precision at query time"
description: "QBit is a new ClickHouse column type that stores BFloat16, Float32 or Float64 vectors as transposed bit planes, each held in a FixedString subcolumn."
url: "https://swe.quest/articles/we-built-a-vector-search-engine-that-lets-you-choose-precision-at-query-time-dd6e891f552187e7"
canonical: "https://clickhouse.com/blog/qbit-vector-search"
source: "ClickHouse"
published: "2025-10-28"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 20
tags: ["vector-search","analytics","storage-engines","performance"]
---

# We built a vector search engine that lets you choose precision at query time

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2025-10-28, 20 min read, Deep dive. Original: [https://clickhouse.com/blog/qbit-vector-search](https://clickhouse.com/blog/qbit-vector-search)

## Summary

QBit is a new ClickHouse column type that stores BFloat16, Float32 or Float64 vectors as transposed bit planes, each held in a FixedString subcolumn. Vector search can then read only the top N bit planes and choose precision at query time, trading recall for I/O and compute without duplicating data or committing to irreversible quantisation. Distance functions like L2DistanceTransposed reconstruct truncated floats with AVX-512 SIMD untransposition, and downcast only the reference vector when the bit layout matches, as with Float32 to BFloat16. Search remains O(n), so HNSW is still faster when its index fits in RAM.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Vector search](https://swe.quest/tags/vector-search.md) (Data & databases)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- vector embeddings and similarity search ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- IEEE-754 floating point
- SIMD vectorization
- columnar databases ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))

## Keywords

ClickHouse, QBit, HNSW, AVX-512, BFloat16, usearch, L2DistanceTransposed

## Related posts

- [Vector Search with ClickHouse - Part 2](https://swe.quest/articles/vector-search-with-clickhouse-part-2-3f7737e1f27114da.md): ClickHouse · 2023-05-31 · Medium · 36 min read · Vector search, Analytics & OLAP, Databases, SQL
  ClickHouse can serve as a vector store by keeping embeddings in Array(Float32) columns and computing distance functions in SQL.
- [What's new in pgvector v0.7.0](https://swe.quest/articles/what-s-new-in-pgvector-v0-7-0-faa9e83678b64f22.md): Supabase · 2024-05-02 · Medium · 5 min read · Vector search, PostgreSQL, Performance engineering
  pgvector 0.7.0 adds float16 (halfvec), sparse and bit vector types to exploit redundancy in embeddings and cut memory and storage.
- [Binary and Scalar Embedding Quantization for Significantly Faster & Cheaper Retrieval](https://swe.quest/articles/binary-and-scalar-embedding-quantization-for-significantly-faster-cheaper-01e481f2c952922f.md): Hugging Face · 2024-03-22 · Medium · 16 min read · Vector search, RAG & retrieval, Cost optimization, Python
  Quantizing embeddings themselves, rather than model weights, sharply cuts retrieval memory, disk and cost.
- [Don’t use vector. Use halvec instead and save 50% of your storage cost](https://swe.quest/articles/don-t-use-vector-use-halvec-instead-and-save-50-of-your-storage-cost-bd6cf6e833bfde8c.md): Neon · 2024-07-31 · Medium · 4 min read · Vector search, PostgreSQL, Performance engineering, RAG & retrieval
  pgvector 0.7's half-precision halfvec type stores embedding components as 16-bit floats instead of 32-bit, cutting table and HNSW index storage nearly in half.
- [Vector Search with ClickHouse - Part 1](https://swe.quest/articles/vector-search-with-clickhouse-part-1-c538ccf9d6af206b.md): ClickHouse · 2023-05-31 · Easy · 14 min read · Vector search, Search, Machine learning
  Vector search replaces term-based inverted indexes, which use TF/IDF or BM25 scoring and can't capture meaning or handle vocabulary mismatch, with embeddings: arrays of floats where semantically similar text, images or audio sit close together under cosine or Euclidean distance.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
