#27657·influxdb

# Performance Advisor for InfluxDB 3 Enterprise: workload insights and schema, query and configuration recommendations

Author: schubertbenjaminCreated Sep 21, 2026Updated Sep 21, 2026

Summary

Build a Performance Advisor into InfluxDB 3 Enterprise, modelled on MongoDB Atlas's Performance Advisor but designed for time series and for self-managed deployments. It has two steps:

  1. Collect and (opt-in) share. Each cluster keeps privacy-preserving statistics about its query shapes, schema and configuration. Customers can choose to send an anonymized version to InfluxData, where it feeds ML and the product team's work on workload classification and benchmarking.
  2. Advise. The product tells users, inside Enterprise, how to restructure queries, schema and configuration for better performance and stability. Each recommendation is ranked by impact, backed by evidence, and comes with the exact command or rewritten query.

Most building blocks already exist in 3.11.4 (query log, anonymized load capture, telemetry, caches, file indexes). The work is mainly to make them persistent, aggregate them by query shape, add a few missing metrics, and put a rules and ML layer on top.

This fits the existing initiative to classify workloads by query type and benchmark query performance. The query-shape statistics proposed here are the input that classification needs from the field, and the benchmarks become the baseline the advisor compares customers against.


Motivation

  • Customers can't see why a cluster is slow or unstable. Performance issues arrive as support tickets. Example: a query-only node with --exec-mem-pool-size 80% on a 16 GB pod commits about 24 GB with the default file cache (20 %) and replica buffer (50 %). It crash-loops under a 15-panel Grafana dashboard instead of rejecting single queries. Nothing in the product warns about this.
  • Performance in InfluxDB 3 depends on choices users don't know about. Time bounds in queries, tag order in the series key, last-value and distinct-value caches, file indexes, LIMIT on sorts (the engine can't spill to disk), and memory, concurrency and CPU settings on query nodes.
  • InfluxData has no fleet-level view of how customers query. Telemetry today covers resource and request counts only. There is no data on query shapes, schema shapes or which anti-patterns are common, so product, docs and benchmarks are prioritised by anecdote.
  • Competitive gap and opportunity. MongoDB has had this for years. Its Performance Advisor is not available for time series collections (per Atlas docs), so a time-series-native advisor would stand out.

Prior art: what MongoDB does

MongoDB capability What it does Notes
Performance Advisor: index suggestions Analyzes slow operations from the slow-query log. The slow threshold is dynamic, based on the cluster's average operation time, or a fixed 100 ms. Suggests indexes ranked by Impact, which is based on total wasted bytes read. Shows per-shape execution count, average time, query targeting (docs scanned vs. returned), in-memory sorts, sample queries. Atlas M10+.
Drop-index suggestions Flags indexes unused for ≥ 7 days, redundant ones (prefix of another index), and hidden ones. Only checks the 20 most active collections.
Schema suggestions / Schema Advisor Detects schema anti-patterns: unbounded arrays, bloated documents, too many collections, unnecessary indexes, excessive $lookup, case-insensitive regex. In the Atlas Performance Advisor ("Improve Schema"), Compass, and Ops/Cloud Manager for self-managed.
$queryStats Per-query-shape runtime statistics. Literals are normalized to types ({item: 'card'} → {item: '?string'}). Collects execCount, total/min/max exec time, docs/keys examined, docs returned, sort stage, disk use, planning time, CPU. transformIdentifiers hashes database, collection and field names with HMAC-SHA-256 using a customer-held key. Memory-bounded to 1 % of RAM.
Query Profiler, Namespace Insights, Real-Time Panel Visual exploration of slow operations and per-collection latency. Supporting UI around the advisor.

What carries over well:

  • Query-shape normalization.
  • "Wasted bytes read" as the impact metric.
  • Drop suggestions for unused structures.
  • HMAC identifier hashing with a customer-held key.
  • Memory-bounded statistics store.
  • Self-managed delivery through an agent or bundle rather than SaaS only.

What doesn't: index-centric advice. InfluxDB 3 has no secondary B-tree indexes. Its levers are time bounds, sort/series-key order, file indexes, bloom filters, the last-value and distinct-value caches, downsampling, and node configuration.


What InfluxDB 3 Enterprise already has (verified in 3.11.4)

Building block What exists today Gap for an advisor
Query log system.queries Per query: query_text, plan/permit/execute/compute/end2end_duration, partitions, parquet_files, max_memory, success, cancelled, trace_id. In memory only; ring buffer of 1 000 entries per node (--query-log-max-entries); lost on restart; not aggregated by shape; no rows scanned/returned or bytes read.
Load capture influxdb3 loadcap (hidden) Capture query, write or both for up to 1 h; list, preview, download (tar.gz), delete. Includes a SQL anonymizer (loadcap/query_anonymizer.rs) that falls back to hashed placeholders for statements it can't parse, and stores anonymized WAL files. Manual and time-boxed; not continuous; no shape statistics or schema context. Probably owned by the workload-classification effort, so reuse it.
Telemetry Sent to https://telemetry.v3.influxdata.com, opt-out with --disable-telemetry-upload. Payload: OS, version, cores, storage engine, CPU/memory min/max/avg, write/query request counts, Parquet file count/size/rows, processing-engine trigger counts, installed packages. No workload shape, schema shape or configuration-risk data.
Licence The Enterprise licence text embedded in the binary includes an "Enhancement Data" clause. It allows InfluxData to analyze such data to improve the software, and to publish only aggregated and anonymized derivatives. The Explorer UI has an analytics consent toggle. Legal needs to confirm whether query shapes and schema metadata fall under it.
Caches and pruning structures Last-value cache (LVC), distinct-value cache (DVC), create file_index, bloom filters (PachaTree). --enable-auto-dvc creates DVCs automatically, up to a cardinality limit. Auto-DVC is precedent for automatically applied advice. There is no usage tracking to recommend creating or dropping caches or indexes.
Schema, storage and node metadata System tables influxdb_schema, tables, parquet_files / pt_files / pt_shards, last_caches, distinct_caches, file_index; system.nodes.cli_params (CLI parameters are captured "redacted and non-redacted"). No per-column cardinality statistics (the planner's distinct_count is always absent); no container limits (memory/CPU).
Metrics /metrics datafusion_mem_pool_bytes, influxdb3_memory_pool_*, jemalloc_memstats_bytes, influxdb3_file_cache_*, influxdb3_replica_ttbr_duration, iox_async_semaphore_permits_*. Not correlated with query shapes.

Proposal

Architecture

mermaid
flowchart LR
  subgraph cluster[Customer cluster — InfluxDB 3 Enterprise]
    Q[query nodes] -->|per-query metrics| QS[(system.query_stats<br/>per shape, persisted)]
    CAT[catalog + storage stats] --> SS[(schema and data snapshot)]
    CFG[node config + limits + metrics] --> CS[(config snapshot)]
    QS --> ADV[Advisor engine<br/>rules + shipped model pack]
    SS --> ADV
    CS --> ADV
    ADV --> REC[(system.advisor_recommendations)]
    REC --> UI[Explorer UI · CLI · API]
    QS --> EXP[Anonymizer / exporter<br/>reuses loadcap]
    SS --> EXP
    CS --> EXP
  end
  EXP -->|opt-in upload| TEL[telemetry.v3.influxdata.com]
  EXP -->|air-gapped: bundle file| SUP[Support upload]
  TEL --> LAKE[(Central workload lake)]
  SUP --> LAKE
  LAKE --> ML[Workload classification · impact models · rule mining]
  BENCH[Benchmark suite<br/>per workload class] --> ML
  ML -->|signed model / rule pack in releases| ADV

Step 2 does not depend on step 1. The advisor runs fully locally: many Enterprise customers are regulated or air-gapped. Central ML improves the advisor for everyone through rule and model packs shipped with releases, so a customer who never uploads anything still benefits.

Step 1: Collect and share

1a. Query-shape statistics (system.query_stats), the InfluxDB version of $queryStats

  • Shape fingerprint: hash of the normalized DataFusion logical plan (SQL and InfluxQL both lower to it).
    • Literals become types.
    • Time bounds become the width of the range, bucketed (e.g. 1h, 24h, 30d), plus distance from now.
    • date_bin / GROUP BY time() intervals are bucketed, so Grafana's $__interval variants collapse into one shape.
  • Per-shape metrics:
    • Counts: exec count; errors by class (RESOURCES_EXHAUSTED, timeout, cancelled).
    • Timing: sum/min/max/p50/p95 of end-to-end, planning, queue-wait (permit_duration) and execute time.
    • Memory: max_memory, and ratio to the pool limit.
    • Data volume: files and partitions scanned plus new metrics: rows scanned, rows returned, bytes read from object store vs. file cache, rows deduplicated, rows from the in-memory buffer.
    • Client: protocol (Flight SQL / HTTP v3 / v1) and client identifier (user agent, e.g. Grafana).
  • Plan features per shape:
    • Tables touched.
    • Predicate columns, classified as time / series-key tag (with position in the sort key) / other tag / field.
    • Group-by keys, aggregates, sort and limit.
    • Joins and window functions.
    • LVC/DVC used; file index used.
  • Storage: memory-bounded, like MongoDB's 1 % cap, and periodically persisted to object store. It survives restarts and is merged cluster-wide rather than kept per node.

1b. Schema and data snapshot (daily)

  • Per table: column counts by type, series-key order, row/file counts and bytes by age bucket, null ratio per column.
  • Cardinality sketches (HyperLogLog) per tag for estimation. This also fills a gap the query planner has today.
  • Caches and file indexes, with hit counts and last-used time.

1c. Configuration snapshot

  • Effective flags (from cli_params), node mode, cores, container memory and CPU limits, storage engine, version.
  • Memory budget sum: exec pool + file cache + replica buffer (+ snapshot memory on ingest nodes) vs. limit.
  • Restarts and OOM kills (from the Kubernetes downward API, or process start time).

1d. Export: privacy levels (per cluster, customer-controlled)

Level What's shared Default
0 Nothing available
1 Today's telemetry (aggregate resource and request metrics) current default
2 Level 1 + query-shape statistics and schema/config snapshots. Literals removed; database, table and column names HMAC-hashed with a customer-held key, following MongoDB's transformIdentifiers (InfluxData can't reverse it; the customer can map hashes back locally for support). opt-in
3 Time-limited, per-support-case upload with real identifiers explicit per session

Delivery options: the existing telemetry endpoint when online, or influxdb3 advisor export producing a bundle for air-gapped sites (same format as loadcap download).

Step 2: Advise

Surfaces

  • system.advisor_recommendations (queryable, so it can go on dashboards and alerts).
  • influxdb3 show recommendations.
  • A Performance Advisor tab in Explorer.
  • An API for partners and tooling.

Each recommendation includes:

  • Category and severity.
  • Impact score, adapted from MongoDB's wasted bytes read: bytes read that did not contribute to results × execution frequency. Memory-risk and stability rules get their own severity scale.
  • Evidence: shapes, sample anonymized queries, metrics.
  • The exact action: a CLI command, rewritten SQL, or a flag change.
  • Status: open, dismissed or applied.
  • Measured before/after effect once applied. These outcomes are also the training labels for step-1 ML.

Initial rule catalogue (heuristic in v1; ML improves ranking later)

Query rules
ID Detects Advice / action
Q1 No time predicate, or very wide time range, on large tables Add time bounds; use Grafana $__timeFilter
Q2 Predicate that blocks pruning (function or cast on time, e.g. date_trunc('day', time) = …) Rewrite as a range predicate (shows the rewritten SQL)
Q3 SELECT * on wide tables where most columns go unused (high bytes read per row returned) Select only needed columns
Q4 Selective filter on a tag that isn't a leading series-key column; many files scanned for few rows influxdb3 create file_index --table … <col>
Q5 "Latest value" pattern (ORDER BY time DESC LIMIT 1 per series, last()) run often influxdb3 create last_cache … (generated command)
Q6 Distinct-values pattern (SELECT DISTINCT tag, SHOW TAG VALUES) Create a DVC, or enable --enable-auto-dvc
Q7 ORDER BY without LIMIT, or high-cardinality GROUP BY, with max_memory near the pool limit or RESOURCES_EXHAUSTED errors (no spill to disk) Add LIMIT, coarsen date_bin, pre-aggregate
Q8 Tiny date_bin over long ranges (too many groups) Grafana min interval; coarser bucket
Q9 Same long-range aggregation run repeatedly (dashboards) Downsampled table via a scheduled processing-engine plugin; point panels at it
Q10 Regex on tags where equality or IN would do Rewrite
Q11 Large results over HTTP pretty or parquet formats (buffered fully in memory) Use Flight SQL or jsonl / csv
Schema rules (time-series anti-patterns)
ID Detects Advice
S1 Table-per-entity (many tables with identical schemas, e.g. cpu_host1, cpu_host2), close to the 4 000-table limit One table with a tag
S2 Near-unique values stored as tags (request IDs, timestamps), or numeric measurements stored as tags Store as fields
S3 Fields that are almost always filtered or grouped on Consider making them tags
S4 Wide, sparse tables (high null ratio) close to the 500-columns-per-table limit Split into several tables by entity type or source
S5 Leading series-key tag rarely used in predicates, while a later one is Tag order guidance for new tables / migration path
S6 Queries never read data older than N days, but retention is unset Set a retention period (storage cost)
S7 LVC/DVC/file index never used in the last 7 days (memory and write cost) Drop it (MongoDB's "drop unused index")
S8 Redundant file indexes (one's columns are a prefix of another's) Drop the redundant one
Configuration and stability rules (beyond MongoDB; this is where many of today's crashes come from)
ID Detects Advice
C1 Memory budgets (--exec-mem-pool-size + --file-cache-size + --replica-max-buffer-size, …) add up to more than the container limit Concrete absolute sizes for the pod (e.g. 16 GB query node: pool 8 GB, file cache 1.5 GB, replica buffer sized to ingest rate)
C2 --max-concurrent-queries unlimited on small nodes with bursty clients (Grafana) Set to about cores / 1–1.5; explain FIFO queueing
C3 No CPU limit, so thread count equals host cores Set a CPU limit or --num-cores
C4 OOM kills or crash loops that correlate with query bursts Link to C1/C2 with evidence
C5 Low file-cache hit rate for hot shapes; object-store connections saturated (default 16) Increase cache or --object-store-connection-limit
C6 Many small query nodes, each holding a full replica buffer Fewer, larger query nodes
C7 Replication lag (ttbr) high relative to how fresh dashboards need data to be Tune replication and snapshot intervals, or ingest capacity

Central side (InfluxData)

  • Ingest: extend telemetry.v3.influxdata.com; store in InfluxDB 3 plus an object-store lake (dogfooding).
  • Workload classification, shared with the existing initiative. Cluster shapes into classes such as dashboard/recent-window, last-value/IoT status, long-range analytics, exports and alert evaluation, and label every customer workload.
  • Benchmarks by class: the benchmark suite gives expected latency and memory per class and data volume. The advisor can then say: "This shape's p95 is 6× the benchmark for comparable data volume."
  • Impact models: learn which recommendations actually help, from before/after outcomes, and use that to rank recommendations.
  • Rule mining: find recurring anti-patterns across the fleet and turn them into new rules.
  • Feedback to product: fleet-wide prevalence of anti-patterns, to prioritise engine work (e.g. spill to disk, memory-aware admission) and docs.
  • Model/rule packs: signed, versioned, and shipped in releases or downloadable, so step 2 improves without per-customer upload.

Phasing

Phase Scope Outcome
0 · Alignment (2–3 wk) Align with the workload-classification/benchmark team and the loadcap owners; define the shape fingerprint; legal review (Enhancement Data clause, GDPR/data residency) Agreed design and consent model
1 · Local foundations Persistent system.query_stats; new per-query metrics (rows scanned/returned, bytes read, cache hits); schema, config and cardinality snapshots Data exists locally; useful to support straight away
2 · Local advisor v1 Rules engine with the catalogue above; system.advisor_recommendations; CLI; Explorer tab First customer-visible value, no ML required
3 · Opt-in sharing Privacy levels 2 and 3; export bundle; central ingest and lake; internal fleet dashboard Fleet-level view of workloads and anti-patterns
4 · ML Workload classification, benchmark comparison, impact ranking, model packs Better-ranked, personalised advice
5 · Safe auto-apply Opt-in automatic creation/removal of LVC, DVC and file indexes, following the --enable-auto-dvc precedent; never automatic schema or config changes Less work for operators

Success metrics

  • Share of Enterprise clusters with the advisor enabled; share opted in to level 2.
  • Recommendation acceptance rate, and measured improvement after applying (p95 latency, bytes read, max_memory).
  • Fewer performance and stability support tickets (OOM, RESOURCES_EXHAUSTED, slow dashboards) and shorter time-to-resolution.
  • Coverage: share of query volume in shapes the advisor can classify.

Open questions

  1. Scope: Enterprise only, or also Core (same query engine; system.queries and telemetry exist there)? Could Cloud Dedicated / Clustered reuse the rules?
  2. Consent default: keep today's level-1 telemetry default and make level 2 opt-in? Does the Enhancement Data clause cover shapes and schema metadata, or is an addendum needed?
  3. Ownership: database team (collection and metrics) vs. Explorer team (UI) vs. data/ML team (central).
  4. Relationship to loadcap: extend it to continuous, low-overhead capture, or keep capture and stats separate?
  5. Fingerprint stability across SQL and InfluxQL and across DataFusion upgrades.
  6. Overhead budget for collection on query nodes (target < 1 % CPU, bounded memory).
  7. Data residency and retention for uploaded data (EU customers).

References