Skip to content

Fix search filter not applied and slicer reset on Fetch (#147)#150

Merged
erikdarlingdata merged 1 commit intodevfrom
fix/147-search-and-slicer-reset
Mar 27, 2026
Merged

Fix search filter not applied and slicer reset on Fetch (#147)#150
erikdarlingdata merged 1 commit intodevfrom
fix/147-search-and-slicer-reset

Conversation

@erikdarlingdata
Copy link
Owner

Summary

Two regressions from the time slicer PR (#114), both in FetchPlansForRangeAsync:

  1. Search filter droppedBuildSearchFilter() result was never passed to FetchTopPlansAsync. The call switched to named params for startUtc/endUtc and filter: was lost in the process.

  2. Slicer resets to 24h on FetchFetch_Click reloads slicer data via LoadTimeSlicerDataAsync, which calls LoadData without the current selection. LoadData defaults to last 24h. Now passes _slicerStartUtc/_slicerEndUtc through to preserve the user's range.

Fixes #147

Test plan

  • Build succeeds (0 errors)
  • Search by Module with a stored procedure name — grid shows only that proc's plans
  • Search by Query ID / Plan ID / Query Hash / Plan Hash — correct filtering
  • Drag slicer to custom range, click Fetch — range is preserved
  • First load (no prior selection) — defaults to last 24h as before

🤖 Generated with Claude Code

Two regressions introduced in the time slicer PR (#114):

1. Search filter (module, query_id, etc.) was built via BuildSearchFilter()
   but never passed to FetchTopPlansAsync — the filter parameter was
   dropped when the call site switched to named parameters for startUtc/
   endUtc. Add filter: back to the call.

2. Clicking Fetch reloads the slicer via LoadTimeSlicerDataAsync, which
   calls LoadData without preserving the current selection. LoadData
   defaults to last 24h when no selection is provided, discarding the
   user's custom range. Pass the current _slicerStartUtc/_slicerEndUtc
   through to LoadData's selectionStart/selectionEnd parameters.

Fixes #147

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rferraton
Copy link
Contributor

rferraton commented Mar 26, 2026

@erikdarlingdata : the {filterSql} in FetchTopPlansAsync is (i think) apply too late in the query : it search inside the top x. if it is what you want, no need sql. To search inside the TOPplans dataset the app already have : a filtering that reduce the list should be fast.
But if you want a deep search (the top x plans where a proc is laucn for exemple) then the filter should be apply in phase 2. That was why i was using LEFT join query_store_query_text : to apply join just in case of a filter on query_store_query_text column was done

@erikdarlingdata erikdarlingdata merged commit a827183 into dev Mar 27, 2026
2 checks passed
@erikdarlingdata erikdarlingdata deleted the fix/147-search-and-slicer-reset branch March 27, 2026 01:57
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.

2 participants