Skip to content

Dashboard improvements, TRUNCATE support, adaptive index fix#14

Open
carli2 wants to merge 2 commits intomasterfrom
worktree-dashboard
Open

Dashboard improvements, TRUNCATE support, adaptive index fix#14
carli2 wants to merge 2 commits intomasterfrom
worktree-dashboard

Conversation

@carli2
Copy link
Contributor

@carli2 carli2 commented Mar 6, 2026

Summary

  • Dashboard: shard detail view with partition ranges, index list, improved JSON rendering; dashboard_json_array empty-list fix ([nil][])
  • TRUNCATE TABLE: implemented as alias for DELETE FROM without WHERE
  • Adaptive index creation fix: extractBoundaries in storage/analyzer.go now handles NthLocalVar(i) as bound lambda parameters — the optimizer replaces symbol references with numbered locals, which previously caused boundary extraction to always return nil, preventing any adaptive indexes from ever being built

Test plan

  • Run existing YAML test suite (tests/)
  • Open dashboard shard detail view — index list should render as [] when empty, and show actual indexes after repeated identical queries
  • TRUNCATE TABLE t / TRUNCATE t should remove all rows and report affected_rows
  • Run a SELECT … WHERE col = ? query 3+ times and confirm "building index" appears in server log

🤖 Generated with Claude Code

carli2 and others added 2 commits March 6, 2026 17:58
- Rename Gauges nav to Status; redirect / to #gauges for admin users
- Add root password warning to gauges, databases, users views with consistent styling
- Move Back link into centered content area
- Fix shard view: expose pivot values from partition schema for range display
- Fix dashboard_json_array for empty lists (was producing "[nil]")
- Fix routing timing: call route() after whoami response so isAdmin is correct
- Add TRUNCATE [TABLE] tbl as alias for DELETE in SQL and PSQL parsers
- Add test case tests/96_truncate.yaml

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…actBoundaries

The Scheme optimizer replaces lambda parameter symbol references with
NthLocalVar(i) in filter lambda bodies. Previously extractBoundaries only
checked symbolmapping (symbol → column), so optimized lambdas never
produced boundaries → no indexes were ever adaptively created.

Fix:
- Add resolveColVar helper that checks both symbolmapping (symbol lookup)
  and NthLocalVar(i) → conditionCols[i] (bound parameter by index)
- Replace all direct IsSymbol+symbolmapping lookups in traverseCondition
  with resolveColVar for: equal?/equal??, </<=, >/>= , nil?, contains?, strlike
- Fix extractConstant for (outer NthLocalVar(i)) case: previously called
  mustSymbolValue which panics on NthLocalVar; now dispatches on IsSymbol
  vs IsNthLocalVar and reads from p.En.VarsNumbered for free outer variables

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant