Databend Query Engine, Cache, and Search Updates: October–November 2026
DatabendLabsDec 3, 2026View Markdown
This article examines the implementation changes, the measurements reported in their pull requests, and the settings or compatibility constraints that matter when evaluating an upgrade.
Release Scope
According to GitHub Releases, the Databend repository published 17 releases in these two months: 15 nightlies from
v1.2.951-nightly
v1.2.971-nightly
v1.2.925-patch-14
v1.2.925-patch-15
Query Execution: Less Decoding, Aggregation Work, and Scanning
Encoded Columns (Experimental)
The new session setting
enable_encoded_columns
0
GROUP BY
Subsequent PRs extended the path to scalar functions and grouping and aggregation over dictionaries. The build side of a Hash Join can retain a dictionary, and a single string probe key can be hashed by dictionary value. With the column cache disabled, Databend reuses Parquet dictionaries but no longer builds a row-by-row dictionary for high-cardinality columns. Virtual columns extracted from VARIANT can retain Parquet dictionaries as well.
The PR benchmarks report warm-query total runtime of 0.69–0.73×
main
Scan, Filter, and Aggregation Changes
Several independent PRs measured the following changes on ClickBench's 100-million-row dataset. Their machines and configurations differed, so the results are not additive.
| Change | Version | Result reported in the PR |
|---|---|---|
Use | | Total runtime for 43 queries fell 4.3% (7.6% with column caching enabled). Peak memory on the first scan of |
| Apply filters on prewhere-only columns before decoding the remaining columns | | For a predicate such as |
Speed up | | Q28 ( |
Rewrite grouped | | Q10 and Q11 fell 41% and 36%, respectively; total runtime fell 4.7%. |
| Emit final aggregation output one block at a time | | Peak memory for Q32, with 100 million groups, fell from 10.2 GiB to 7.7 GiB. |
Aggregation Execution
The aggregation rewrite covers transport, partial aggregation, and hash-table layout. Each exchange connection can have up to four frames in flight, reducing idle time when CPUs are saturated. A thread now chooses among a small table, table expansion, or bypass at runtime using its input row count, number of groups already built, and a HyperLogLog estimate of distinct keys. Output uses a global shuffle; the old
legacy
Hash-table indexes, rows, and aggregation states now use paged storage. A probe reads fewer cache lines, and serialized states can be merged directly. The PR reports 12–37% lower runtime for more than 4 million groups on Graviton4 and 12–43% less memory across the tested group counts. Below 256,000 groups, runtime differed from the old implementation by 0–7%.
Other aggregation changes have distinct behavior and controls:
-
Heavy-hitter aggregation can count only the frequent keys precisely for a pattern such as
, while keeping the result exact. SetSELECT key, COUNT(*) c ... GROUP BY key ORDER BY c DESC LIMIT nto use it; it is off by default.enable_heavy_hitter_aggregate -
Cascading grouping sets are now on by default. Lower levels of
,ROLLUP, andCUBEderive from the nearest higher-level result. Set the option toGROUPING SETSto restore the earlier behavior.0 -
Aggregating materialized-view
now streams aggregation states. It no longer spills at the final aggregation stage, avoiding the Arrow 2 GiB limit error when a large state was read back.REFRESH
Runtime Pruning and Condition Cache
Runtime TopN pruning now uses the first sort key in a multi-column sort. It can pass through
UNION ALL
UNION ALL
Segment Zone Map adds a snapshot-level file containing min, max, and null-count summaries by segment. Built by reclustering and enabled by default, it lets a scan rule out segments before reading their metadata. If the file is missing or stale, Databend falls back to ordinary segment pruning without changing the result.
Condition Cache stores matching rows for each deterministic prewhere condition and data-block pair. A repeated filter can skip blocks with no matches; a
count(*)
enable_condition_cache
SELECT COUNT(*) FROM hits WHERE URL LIKE '%google%'
Memory and Cache Allocation
Previously, 24 Query-node caches each had a separate LRU and capacity. Their configured capacities could add up to more than node memory, and they did not shrink under pressure. The shared backend now divides memory into meta, index, and data pools, allocates against the server memory limit, and reclaims cache space under pressure.
query.max_memory_limit_enabled
cache.shared_memory_enabled
true
max_server_memory_usage = 0
cache.data_max_ratio
0
Disk caching has also been consolidated. Instead of a disk tier for each memory cache, a single cache below the read layer stores the original object bytes:
[cache]
data_cache_storage = "disk"
[cache.disk]
path = "/var/lib/databend/cache"
# Without max_bytes, the cache uses up to about 85% of the disk, capped at 1 TiB.
The default remains
data_cache_storage = "none"
disk_cache_*_size
GET /v1/caches
Vector and Full-Text Search
HNSW Storage and FP16 Refinement
Each vector index on each data block now has one bundle containing its HNSW graph, SQ8 quantized values, optional FP16 original vectors, and a checksum. Old Parquet index files remain readable.
REFRESH VECTOR INDEX
VACUUM
With
refine = true
LIMIT × vector_refine_factor
vector_refine_factor
2
0
vector_search_ef
CREATE TABLE t (
id INT NOT NULL,
embedding VECTOR(768) NOT NULL,
VECTOR INDEX idx (embedding) distance = 'cosine' m = 16 ef_construct = 200 refine = true
);
-- After creating an index on an existing table, build it for existing blocks.
CREATE VECTOR INDEX idx ON t(embedding) distance = 'cosine' refine = true;
REFRESH VECTOR INDEX idx ON t;
SELECT id, cosine_distance(embedding, [0.1, 0.2, ...]::VECTOR(768)) AS d
FROM t ORDER BY d LIMIT 10;
Neighbor-vector prefetching and AVX-VNNI/AVX-512 VNNI on x86 or ARM
udot
Other per-query changes parse a 768-dimensional vector literal directly from tokens, redact SQL only once, and use 2 MiB huge pages for HNSW buffers. In the PR's VectorDBBench Performance768D10M test (10 million Cohere vectors of 768 dimensions), recall stayed at 0.958 while QPS rose 27% with default settings. A separate one-million-row, 64-concurrent-client test reported about 1,400 QPS and a P99 near 53 ms for vector-only retrieval.
There are correctness fixes as well. HNSW construction with cosine distance now uses normalized vectors; for non-unit-length data, recall in the PR test rose from 0.196 to 0.904. The releases also fix a constant offset in SQ8 scoring for L2 distance and dead zones caused by duplicate vectors in the graph.
REFRESH VECTOR INDEX
Full-Text Index Access
For a top-N query ordered by
score()
Full-text and vector TopN queries can read candidates directly from index-hit blocks, with roughly 20% higher QPS in one PR test. Another change decodes only rows matched by the inverted index, cutting scan and filter CPU time by about 75% and increasing QPS by about 29% in its test.
The inverted index also gains
user_dictionary
mode = 'decompose'
tokenizer = 'whitespace'
CREATE INVERTED INDEX idx ON news(content)
tokenizer = 'japanese' user_dictionary = '@ja_dict/userdict.csv';
Fixed Costs Under Search Concurrency
For short full-text and vector queries, thread creation and metadata reads can dominate at high concurrency. Pruning now uses a global runtime rather than creating
max_threads
v1.2.971
v1.2.971
SELECT
v1.2.968
The PR's test used a 16-core node, with 12 cores running Databend, one-million-row full-text and vector tables, and 64 concurrent clients:
| Workload | Before | After |
|---|---|---|
| Full-text search, one data block | 1,473 QPS | 1,960 QPS (+33%) |
| Full-text search, four data blocks | 982 QPS | 1,344 QPS (+37%) |
| Vector search, four data blocks | 1,243 QPS | 1,411 QPS (+14%) |
| P99 at 1,450 mixed requests/s (half full-text, half vector) | 1.2 s / 1.5 s; unable to keep up | 22 ms / 24 ms |
These figures are from #21254. In a separate, similar test, thread reuse (#21256) lowered full-text and vector P99 by about 82% and 91%, respectively, with four data blocks. #21254 showed no regression on TPC-H SF10 or TPC-DS SF100.
Table Management and Writes
Zero-Copy Table Cloning (Experimental)
CREATE TABLE ... CLONE
SET enable_experimental_clone_table = 1;
CREATE TABLE orders_dev CLONE orders;
CREATE TABLE orders_snapshot CLONE orders AT (TIMESTAMP => '2026-11-01 00:00:00'::TIMESTAMP);
VACUUM
PURGE
STREAM
BEFORE
VACUUM DROP
Manual Row-Level TTL Materialization
The previous release introduced TTL definitions and metadata. This release adds a command to remove expired rows:
CREATE TABLE events (id INT, event_time TIMESTAMP) TTL event_time + INTERVAL 30 DAY;
ALTER TABLE events MATERIALIZE TTL;
MATERIALIZE TTL
+ INTERVAL n unit
ALTER
Partitioning, Reclustering, and Ingestion
-
Fuse tables can
and add a new key without rewriting existing data. Partition statistics are versioned, like clustering keys, to prevent incorrect pruning after a definition changes. Tables using versioned partition metadata require metadata reader version 188 or later.DROP PARTITION KEY -
Ordinary tables and materialized views now use
. The formerOPTIMIZE TABLE ... RECLUSTER [FINAL] [WHERE ...] [LIMIT n]andALTER TABLE ... RECLUSTERremain aliases. Reclustering tasks can be scheduled in batches according to each node's budget.ALTER MATERIALIZED VIEW ... RECLUSTER -
Horizontal reclustering gained streaming multiway merge and reuse of compatible inverted indexes in October. Because some workloads regressed,
was subsequently changed to off by default and must be enabled explicitly.enable_recluster_multiway_merge -
With
, the input files are declared sorted by the target table's linear cluster key. COPY retains each file's row order and produces nonoverlapping blocks on that key, avoiding a post-load recluster. Databend checks the first and last row of each batch and errors when batches are out of order, but cannot detect disorder within a batch. The option supports CSV, NDJSON, TEXT, and Parquet, but not COPY with a transformation query or tables withCOPY INTO ... SORTED_BY_CLUSTER_KEY = TRUE.PARTITION BY -
When
requires a data rewrite, conversion and writing run in parallel across nodes rather than on the coordinator alone.ALTER TABLE ... MODIFY COLUMN -
Databases can set
and external Fuse tables can setDEFAULT_S3_STORAGE_CLASStoS3_STORAGE_CLASSorstandard.intelligent_tiering
Partial-column UPDATE, which would rewrite only the columns involved, received three preparatory PRs for metadata, the read path, and Bloom pruning. Its write path has not merged. It does not yet produce split data blocks and is not a usable feature in this release.
Security and Access Control
Python UDF Isolation and External Access
Previously, a Python UDF worker inherited the Query node's environment variables, including cloud credentials, and could read node configuration or contact internal services. The worker model and access rules have changed:
-
Each Python scalar-UDF query gets a dedicated worker process, reused within that SQL statement but not across statements. Concurrency follows
.max_threads -
Before executing user code on Linux, each worker enters an unprivileged sandbox. Landlock restricts filesystem access, while seccomp blocks system calls such as socket creation and launching another program. Execution is rejected if sandbox entry fails. This requires Linux 5.13+ with Landlock enabled, and the container's seccomp profile must permit
calls. JavaScript/WebAssembly UDFs also gain execution-time and memory limits.landlock_* -
A Python UDF can reach approved HTTP(S) hosts through
andNETWORK RULE. Operations must enableEXTERNAL ACCESS INTEGRATION(off by default). Databend checks DNS results before connection and rejects private, loopback, and metadata-service addresses by default.query.enable_python_udf_external_access -
Remote UDF endpoints can be governed with the same objects. Referencing an integration requires
; after an integration is disabled, nodes reject requests from existing functions once they receive the metadata change.USAGE
CREATE OR REPLACE NETWORK RULE video_rule
TYPE = HOST_PORT
VALUE_LIST = ('video.example.com:443')
MODE = EGRESS;
CREATE OR REPLACE EXTERNAL ACCESS INTEGRATION video_access
ALLOWED_NETWORK_RULES = (video_rule)
ENABLED = TRUE;
GRANT USAGE ON INTEGRATION video_access TO ROLE developer;
CREATE FUNCTION parse_video(STRING)
RETURNS VARIANT
LANGUAGE python
HANDLER = 'parse_video'
ADDRESS = 'https://video.example.com'
EXTERNAL_ACCESS_INTEGRATIONS = (video_access);
The sandbox is a breaking change. Python UDFs that use
subprocess
multiprocessing
Masking, Materialized Views, and Object Privileges
When binding a masking policy, the data owner can set
where_use_unmasked_value = true
SELECT
WHERE
JOIN ON
GROUP BY
HAVING
ORDER BY
ALTER TABLE events
MODIFY COLUMN data SET MASKING POLICY mask_data
OPTIONS (where_use_unmasked_value = true);
Direct reads of a materialized view now need its own
SELECT
ATTACH TABLE
CREATE
account_admin
Without global
GRANT
system.users
system.roles
HTTP Query Sessions
Follow-up requests for an HTTP query—result pages, status, and cancellation—remain tied to the credential used at submission. Clients need no change. If the user's password changes while a query runs, the existing connection can still finish reading results without repeated polling failures triggering an account lockout. HTTP kill, final, state, page, and heartbeat endpoints also check the query's tenant and user ownership, including for
SUPER
A user without
SUPER
p-<UUID>
connection_id()
system.processes.id
WRITE
COPY
Operations and SQL
-
The management port adds
endpoints to start and stop CPU sampling and retrieve a flame graph for a running query, or for all threads on all nodes. No setup before query execution is required./v1/queries/:query_id/perf -
sends through an existing notification integration. It requires globalsend_notification; Cloud Control delivers the notification asynchronously.SUPER
CALL system$send_notification('oncall', 'Query errors detected');
-
returns a connection definition with credentials redacted by default; unknown new options are redacted too.SHOW CREATE CONNECTION
-
accepts a/v1/session/loginfield. A DSN can log in even when its database exists only in an external catalog such as Iceberg; bendsql also supports acatalogDSN parameter.catalog
-
With
configured, Query nodes retain local watched copies of users, global settings, and cluster nodes, reducing meta-service reads. It is off by default. Because updates propagate asynchronously, deleting a user or changing a password may take effect after a delay.cache.meta_service_caches -
Task scheduler fixes address permanent scheduling termination after an error during meta-leader changes, a departed execution node leaving a task permanently classified as overlapping, and a deleted task recreated under the same name losing its schedule.
-
,to_string(binary, charset)/convert_from, and theirconvert_tocounterparts decode encodings such as GBK in SQL. For example,try_*returnsto_string(from_base64('xOO6ww=='), 'gbk').你好
Correctness and Resource Cleanup
The release fixes
UNION ALL
INSERT ... SELECT
Decimal arithmetic, casts, and rounding have been revised. Multiplication and division round half away from zero, use wider intermediate integer types when necessary, and raise errors such as
Decimal overflow
quantile_cont
sum
avg
In the Iceberg catalog, CTAS and columns of type DECIMAL, TUPLE, ARRAY, and MAP can now be created and written.
bucket
truncate
INSERT OVERWRITE
TRUNCATE TABLE
ALTER TABLE ADD/DROP COLUMN
abfs[s]
Under memory pressure, final sort segments can spill. Window-partition restoration, hash shuffle memory (independent of cluster size), and all-pairs joins are bounded. Fixes cover hash-join probing across multiple spill rounds, reading back spilled data types, and decoding very large Fuse blocks in batches according to
max_block_size
Client and Repository Updates
The November
bendsql
v0.34.3
!mode
sql
smart
agent
For Databend Cloud, bendsql can connect directly using a personal Cloud API Token and organization ID, for example
bendsql --org <organization-id>
catalog
server_side_params
ps
There were no new
databend-jdbc
LICENSE
LICENSING.md
Upgrade Checks
Several defaults and behaviors changed. Validate against the release notes for the exact target version before upgrading.
Memory and Cache
-
The server memory limit and shared cache backend are on by default. Without an explicit
, the limit is 80% of physical memory or the cgroup limit, and spill thresholds change with it. Reassess nodes that relied on effectively unlimited memory.max_server_memory_usage -
The shared backend does not read the former per-cache
capacities. To retain the old backend, setcache.*.cache.shared_memory_enabled = false -
defaults tocache.data_max_ratio, leaving deserialized column data out of the in-memory cache unless configured.0
-
For nodes using disk cache, the former
settings are ignored, and old-layout files are removed on first startup. Plan for cache warm-up.disk_cache_*_size
Security and Privileges
-
Python UDFs require Linux 5.13+ and enabled Landlock. UDFs that rely on subprocesses, network access, or arbitrary files may fail under the sandbox.
-
Creating a materialized view over a source with row-access or masking policies is rejected. Existing combinations fail validation on read and refresh, although
andSHOW CREATEremain available.DROP -
Attaching a table requires an explicit
grant.ATTACH TABLE -
Without global
, a user sees only their permitted identity information inGRANTandsystem.users.system.roles
Behavior and Configuration
-
The session setting
, previously available only in nightlies, is renameds3_storage_classand applies only to external tables. Internal-table storage class is controlled by server-sideexperimental_s3_storage_class.[storage.s3].storage_class -
Cascading grouping sets are on by default;
is off by default; andenable_recluster_multiway_mergeno longer acceptspartial_aggregate_mode.legacy -
Decimal results beyond declared precision now error, and rounding uses half away from zero. Recheck queries that depend on the previous results.
-
In the Iceberg catalog,
,INSERT OVERWRITE, andTRUNCATE TABLEnow explicitly report that they are unsupported instead of silently appending or doing nothing.ALTER TABLE ADD/DROP COLUMN -
The
table function andtenant_quotahave been removed. Quotas are configured underCALL admin$tenant_quota(...).[query.quota] -
Binary version strings no longer contain the
suffix (for example,-nightly). Release tag names have not changed; scripts parsing the binary version may need updating.v1.2.952
Metadata Compatibility
Versioned partitions used by
DROP PARTITION KEY
Closing Notes
Over October and November, Databend improved query execution, memory allocation, and search, alongside table management, security, and correctness. Together, these changes extend the lakehouse platform's ability to handle analytics and search workloads in one place, including BI, log analysis, and AI applications. Databend continues to iterate on these capabilities. Try the updates against your own workload and share the results, problems, and areas you would like to see improved.
For details, see the Databend repository, documentation, and release notes for the target version.
Subscribe to our newsletter
Stay informed on feature releases, product roadmap, support, and cloud offerings!



