diff --git a/src/PlanViewer.App/Controls/QueryStoreGridControl.axaml.cs b/src/PlanViewer.App/Controls/QueryStoreGridControl.axaml.cs index a192af6..08f3ee1 100644 --- a/src/PlanViewer.App/Controls/QueryStoreGridControl.axaml.cs +++ b/src/PlanViewer.App/Controls/QueryStoreGridControl.axaml.cs @@ -587,12 +587,19 @@ private void LoadHighlightedPlan_Click(object? sender, RoutedEventArgs e) private async void ViewHistory_Click(object? sender, RoutedEventArgs e) { if (ResultsGrid.SelectedItem is not QueryStoreRow row) return; + if (string.IsNullOrEmpty(row.QueryHash)) return; + + var metricTag = QueryStoreHistoryWindow.MapOrderByToMetricTag(_lastFetchedOrderBy); var window = new QueryStoreHistoryWindow( _connectionString, - row.QueryId, + row.QueryHash, row.FullQueryText, - _database); + _database, + initialMetricTag: metricTag, + slicerStartUtc: _slicerStartUtc, + slicerEndUtc: _slicerEndUtc, + slicerDaysBack: _slicerDaysBack); var topLevel = Avalonia.Controls.TopLevel.GetTopLevel(this); if (topLevel is Window parentWindow) diff --git a/src/PlanViewer.App/Dialogs/QueryStoreHistoryWindow.axaml b/src/PlanViewer.App/Dialogs/QueryStoreHistoryWindow.axaml index 08e58fb..04d9188 100644 --- a/src/PlanViewer.App/Dialogs/QueryStoreHistoryWindow.axaml +++ b/src/PlanViewer.App/Dialogs/QueryStoreHistoryWindow.axaml @@ -9,26 +9,43 @@ Icon="avares://PlanViewer.App/EDD.ico" Background="{DynamicResource BackgroundBrush}"> - + - - - + + + + + + + + + + + + + - - + - + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + - - +