Jack 1106a37488 [improvement](be) Cut per-document work in SNII docid decode (#69909)
### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: An equality filter reads a posting list of millions of
documents through
`decode_window_prefix_plan`, so small costs per document, per PFOR run
or per window add up. In the
stack samples of a filtered phrase prefix query on a 99M-row table:
- The window loop cleared its vector, so every window zero-filled it
again before decoding wrote over
  it (4% of the SNII samples).
- The sum of the docid deltas checked for a zero delta and for overflow
at every document (about 7%,
  with the sum itself).
- Each PFOR run read its exception count, and each exception its two
fields, through the out-of-line
  varint decoders, although they are nearly always one byte (about 5%).

The window loop now decodes over the vector, so a resize zero-fills only
what it adds. A window's
deltas are checked whole, with no branch per document, before they are
summed: the same checks, and
the same error code when one fails. If a window breaks more than one of
them, the zero delta is
reported first, whichever came first in the window. `pfor_decode` and
`pfor_skip` use
`get_varint32_fast`, which handles a one-byte value inline and leaves
anything else to the checked
decoder. The on-disk format and the write path do not change.

| Query (99M rows), new/previous | Hot | Lowest run, new/previous | Cold
|
|---|---|---|---|
| filtered phrase prefix | 0.94 / 0.96 / 0.86 | 0.95 / 0.93 / 0.93 |
0.98 |
| phrase with tenant, app, type and status | 0.92 / 0.92 / 0.98 | 0.92 /
0.95 / 0.95 | 0.95 |
| phrase with a latency filter | 0.95 / 0.91 / 0.99 | 0.94 / 0.92 / 0.96
| |
| MATCH_ALL with the same four filters | 0.94 / 0.92 / 1.10 | 0.94 /
0.93 / 0.93 | |
| top-50 with tenant and payload equalities | 0.94 / 0.94 / 0.95 | 0.95
/ 0.94 / 0.99 | 1.00 |
| the other queries | 0.93-1.03 | | |

Hot: both versions interleaved in one BE process on a quiet host, three
runs each. Cold: BE restarted
and the index files evicted before every run, configuration order
alternated, 8 runs for the phrase
prefix, 5 for the others. The build also had #69879, #69882, #69887,
#69891 and #69895.
2026-11-02 09:19:28 +08:00
…
…
…
…
…
…
…
…
…
…
…

🌍 Read this in other language

English • العربية • বাংলা • Deutsch • Español • فارسی • Français • हिन्दी • Bahasa Indonesia • Italiano • 日本語 • 한국어 • Polski • Português • Română • Русский • Slovenščina • ไทย • Türkçe • Українська • Tiếng Việt • 简体中文 • 繁體中文

Apache Doris

License GitHub release Slack EN doc CN doc

Official Website Quick Download

     

apache%2Fdoris | Trendshift

Apache Doris is an open-source, real-time analytics and search database built on MPP architecture. It provides fast SQL analytics, lakehouse query acceleration, and hybrid search across structured, text, and vector data.

Explore the official website for the latest product overview, use cases, ecosystem updates, blogs, and user stories. For version updates, see all release notes.

📈 Use Cases

Use Case What it provides
Customer-Facing Analytics Ship sub-second interactive analytics to external users.
Data Warehousing Build one real-time warehouse across business domains.
Observability Analyze high-throughput logs, events, and metrics with SQL.
Doris for AI Use vector, text, JSON, and structured search in one SQL engine.

🚀 Core Capabilities

Apache Doris is built around three core capabilities. The website is the source of truth for detailed product descriptions and examples.

Capability What it provides
Real-Time Analytics Streaming ingestion, incremental transformation, and sub-second queries under high concurrency.
Lakehouse Analytics Fast SQL analytics over open table formats such as Iceberg, Delta Lake, and Hudi.
Hybrid Search SQL-native analytics across JSON, full-text, and vector data for AI and search workloads.

🔌 Ecosystem

Doris sits at the center of the modern data stack. It connects upstream databases, streaming systems, and lakehouse storage with downstream BI, AI, analytics, and observability tools.

Apache Doris ecosystem

For the latest ecosystem coverage, visit the official website and the connection and integration documentation.

👣 Get Started

🧱 Architecture

Apache Doris supports both compute-storage coupled and compute-storage decoupled deployments. In decoupled mode, stateless compute groups run over shared object storage, so you can scale compute on demand and isolate workloads.

Apache Doris compute-storage decoupled architecture

Learn more in the deployment guide and deployment mode guide.

📣 Project Updates

Resource What it provides
Community Report Weekly updates on community activity, merged PRs, contributors, and feature progress.
Roadmap 2026 The 2026 planning discussion for AI and hybrid search, query engine, storage, and data lake work.

🧩 Components

Doris provides connectors and tools for common data engineering workflows.

👨‍👩‍👧‍👦 Users

Apache Doris is used in production by thousands of companies worldwide across internet services, finance, retail, logistics, manufacturing, energy, telecommunications, AI, and other industries.

🙌 Contributors

Apache Doris graduated from the Apache Incubator and became an Apache Top-Level Project in June 2022. Thanks to all community contributors who help build Doris.

contrib graph

🌈 Community and Support

💬 Contact Us

📜 License

Apache License, Version 2.0

Note

Some licenses of the third-party dependencies are not compatible with Apache 2.0 License. So you need to disable some Doris features to comply with Apache 2.0 License. For details, refer to the thirdparty/LICENSE.txt

Languages
Java 43.5%
C++ 39%
Csound 12.3%
Python 3.2%
Shell 0.8%
Other 0.9%