Skip to content

feat(analysis): add QueryHash cache layer with IAnalysisCache#109

Merged
cct08311github merged 2 commits intodotnet8from
issue-97-analysis-cache
Mar 9, 2026
Merged

feat(analysis): add QueryHash cache layer with IAnalysisCache#109
cct08311github merged 2 commits intodotnet8from
issue-97-analysis-cache

Conversation

@cct08311github
Copy link
Copy Markdown
Owner

Summary

  • Define IAnalysisCache interface (TryGet/Set/Invalidate/InvalidateAll)
  • Implement MemoryAnalysisCache wrapping IMemoryCache (5-min default TTL, CancellationTokenSource-based InvalidateAll)
  • Add NullAnalysisCache no-op implementation for disabled caching
  • Integrate into AnalysisQueryEngine — hash computed before query for cache lookup, results stored after
  • Wire DI: FrameworkServiceExtension.AddWtmContext() registers AddMemoryCache() + IAnalysisCache
  • _AnalysisController accepts IAnalysisCache? via constructor injection

Closes #97

Test plan

  • 7 new cache tests (NullCache, MemoryCache set/get/invalidate/expiry, Engine integration)
  • All 76 Analysis tests pass (69 existing + 7 new)
  • Build 0 errors
  • Backward compatible: parameterless AnalysisQueryEngine() still works

🤖 Generated with Claude Code

cct0831 and others added 2 commits March 9, 2026 21:16
Prepare for parallel worktree-based development workflow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…97)

Add IAnalysisCache interface + MemoryAnalysisCache (IMemoryCache-backed,
5 min default TTL, CancellationToken-based InvalidateAll) and
NullAnalysisCache no-op implementation. Integrate into
AnalysisQueryEngine (cache lookup before query, store after) and
_AnalysisController (DI injection). Register in FrameworkServiceExtension.
7 new MSTest tests covering both implementations and engine integration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@cct08311github cct08311github merged commit 78bb671 into dotnet8 Mar 9, 2026
4 checks passed
cct08311github pushed a commit that referenced this pull request Mar 9, 2026
…#98)

Add DateTruncator static class that builds Expression Trees using
DateTime.Year/.Month/.Day CLR properties for cross-DB safe date
truncation in GroupBy operations. Supports Year, Quarter, Month, Day
hierarchies with integer key encoding and human-readable formatting.

Also fix pre-existing AnalysisQueryEngine duplicate constructor conflict
(from merged #108 + #109) and remove dead ExecuteGroupBy/BuildGroupKey
methods already extracted to InProcessGroupByStrategy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cct08311github pushed a commit that referenced this pull request Mar 9, 2026
 #111)

PR #108 (GroupByStrategyResolver) and #109 (IAnalysisCache) each added a
parameterless constructor to AnalysisQueryEngine. GitHub auto-merge didn't
detect the semantic conflict, causing CS0111 on dotnet8.

- Merge both constructor sets into unified ctor accepting both resolver + cache
- Remove dead ExecuteGroupBy/BuildGroupKey methods (already in InProcessGroupByStrategy)
- Update _AnalysisController and cache tests to use new ctor signature

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cct08311github cct08311github deleted the issue-97-analysis-cache branch March 20, 2026 12:38
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.

[Phase2-1.5] QueryHash 快取層 (IAnalysisCache + MemoryCache)

1 participant