Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Apache Druid Query History

From Leeroopedia
Revision as of 18:07, 16 February 2026 by Admin (talk | contribs) (Auto-imported from principles/Apache_Druid_Query_History.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Knowledge Sources
Domains SQL_Querying, Developer_Experience
Last Updated 2026-02-10 00:00 GMT

Overview

A query persistence principle that maintains a local history of executed queries for recall, re-execution, and iterative development.

Description

Query History captures and persists executed queries in the browser's localStorage, enabling users to recall and re-execute previous queries. The history serves as a lightweight version control for iterative query development.

Key behaviors:

  • Queries are added to history after each execution
  • Duplicate consecutive queries are not added (deduplication via JSON comparison)
  • History is capped at a maximum number of entries (currently 10)
  • Each entry stores the full WorkbenchQuery object (query text + context) with an ISO timestamp
  • History persists across browser sessions via localStorage

Usage

Use this principle for iterative query development where users need to recall and modify previous queries. The history dialog is accessible from the Workbench toolbar.

Theoretical Basis

Query history follows a bounded LIFO stack with deduplication pattern:

History Stack:
  maxEntries = 10

addQueryToHistory(query):
  if history[0] == query:  // JSON deep comparison
    return  // Deduplicate
  history = [{ version: ISO_timestamp, query }, ...history].slice(0, maxEntries)
  persist(history)  // localStorage

getHistory():
  return parse(localStorage[WORKBENCH_HISTORY]) || []

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment