Prompt

Why are my metrics queries getting slower after compaction?

Technology / Databases1 observationLast seen Oct 25, 2026

Latest observation

Oct 25, 2026OpenAI APIWeb search: off

Compaction can make metrics queries slower for a few common reasons, even though it usually helps storage efficiency overall.

Likely causes

  1. Fewer but much larger files/blocks

    • After compaction, data may be merged into larger chunks.
    • If your query only needs a small time range, it may still have to scan a big compacted block.
    • Large blocks can increase read amplification and disk I/O for selective queries.
  2. Loss of “fresh” indexing or metadata granularity

    • Before compaction, smaller files may let the query engine skip more data using file-level metadata.
    • After compaction, that pruning can be less effective if the engine treats the merged file as one unit.
  3. Compaction created less optimal sort order

    • If the compacted data isn’t sorted the way your queries filter/group, queries may scan more rows.
    • This is especially noticeable for label-based metrics queries.
  4. Hot cache got invalidated

    • Compaction rewrites data, so previously cached blocks/pages may no longer be usable.
    • Right after compaction, queries can be slower until caches warm back up.
  5. Resource contention from the compaction job

    • If compaction is still running or recently ran, it may compete for:
      • CPU
      • disk bandwidth
      • memory
      • network I/O
    • Queries can slow down even if the compacted data itself is better.
  6. Too aggressive compaction

    • Over-compaction can reduce parallelism.
    • With too few large objects, the query engine has fewer pieces to read in parallel.
  7. Query planner changes

    • The engine may choose a different plan after compaction because stats, file counts, or partition layout changed.
    • Sometimes the new plan is worse for your workload.
  8. Compression tradeoff

    • Compaction often increases compression ratio.
    • Better compression means less storage, but decompression can cost more CPU, which may slow query latency if CPU-bound.

What to check

  • Compare query latency before/after compaction for:
    • small time ranges
    • wide time ranges
    • highly selective label filters
  • Look at whether compaction:
    • increased file/block size too much
    • reduced file count drastically
    • changed sort order
  • Check for:
    • higher disk read bytes
    • higher CPU usage
    • cache misses
    • compaction running concurrently with queries
  • Inspect query plans if your system provides them.

Typical fixes

  • Tune compaction to keep block sizes at a query-friendly size.
  • Preserve or improve sort order on common query keys.
  • Schedule compaction during off-peak hours.
  • Ensure query caches are warmed after compaction.
  • Avoid making files so large that selective queries must scan too much.
  • If supported, use tiered compaction instead of over-merging everything at once.

If you tell me what system you’re using—Prometheus, Mimir, Cortex, Thanos, ClickHouse, InfluxDB, TimescaleDB, or something else—I can give a more precise explanation and tuning advice.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.