diff --git a/src/LinqTests/Acceptance/diagnostic_methods.cs b/src/LinqTests/Acceptance/diagnostic_methods.cs index eae94825a2..267b5170fd 100644 --- a/src/LinqTests/Acceptance/diagnostic_methods.cs +++ b/src/LinqTests/Acceptance/diagnostic_methods.cs @@ -36,9 +36,9 @@ public async Task retrieves_query_plan() var plan = await theSession.Query().ExplainAsync(); plan.ShouldNotBeNull(); - plan.PlanWidth.ShouldBeGreaterThan(0); - plan.PlanRows.ShouldBeGreaterThan(0); - plan.TotalCost.ShouldBeGreaterThan(0m); + plan.PlanWidth.Value.ShouldBeGreaterThan(0); + plan.PlanRows.Value.ShouldBeGreaterThan(0); + plan.TotalCost.Value.ShouldBeGreaterThan(0m); } [Fact] @@ -63,9 +63,9 @@ public async Task retrieves_query_plan_with_where() var plan = await theSession.Query().Where(u => u.Number > 5).ExplainAsync(); plan.ShouldNotBeNull(); - plan.PlanWidth.ShouldBeGreaterThan(0); - plan.PlanRows.ShouldBeGreaterThan(0); - plan.TotalCost.ShouldBeGreaterThan(0m); + plan.PlanWidth.Value.ShouldBeGreaterThan(0); + plan.PlanRows.Value.ShouldBeGreaterThan(0); + plan.TotalCost.Value.ShouldBeGreaterThan(0m); } [Fact] @@ -100,7 +100,7 @@ public async Task retrieves_query_plan_with_where_and_all_options_enabled() .Verbose(); }); plan.ShouldNotBeNull(); - plan.ActualTotalTime.ShouldBeGreaterThan(0m); + plan.ActualTotalTime.Value.ShouldBeGreaterThan(0m); plan.PlanningTime.ShouldBeGreaterThan(0m); plan.ExecutionTime.ShouldBeGreaterThan(0m); plan.SortKey.ShouldContain("(((d.data ->> 'Number'::text))::integer)"); diff --git a/src/Marten/Linq/QueryPlan.cs b/src/Marten/Linq/QueryPlan.cs index 2f13fe33e8..a18c5ebdf2 100644 --- a/src/Marten/Linq/QueryPlan.cs +++ b/src/Marten/Linq/QueryPlan.cs @@ -35,7 +35,7 @@ public class QueryPlan /// [JsonPropertyName("Startup Cost")] [JsonProperty(PropertyName = "Startup Cost")] - public decimal StartupCost { get; set; } + public decimal? StartupCost { get; set; } /// /// The cost ofo performing the query. @@ -43,21 +43,21 @@ public class QueryPlan /// [JsonPropertyName("Total Cost")] [JsonProperty(PropertyName = "Total Cost")] - public decimal TotalCost { get; set; } + public decimal? TotalCost { get; set; } /// /// The estimated number of rows returned. /// [JsonPropertyName("Plan Rows")] [JsonProperty(PropertyName = "Plan Rows")] - public int PlanRows { get; set; } + public int? PlanRows { get; set; } /// /// The storage size of the query returned fields. /// [JsonPropertyName("Plan Width")] [JsonProperty(PropertyName = "Plan Width")] - public int PlanWidth { get; set; } + public int? PlanWidth { get; set; } [JsonPropertyName("Parallel Aware")] [JsonProperty(PropertyName = "Parallel Aware")] @@ -65,19 +65,19 @@ public class QueryPlan [JsonPropertyName("Actual Startup Time")] [JsonProperty(PropertyName = "Actual Startup Time")] - public decimal ActualStartupTime { get; set; } + public decimal? ActualStartupTime { get; set; } [JsonPropertyName("Actual Total Time")] [JsonProperty(PropertyName = "Actual Total Time")] - public decimal ActualTotalTime { get; set; } + public decimal? ActualTotalTime { get; set; } [JsonPropertyName("Actual Rows")] [JsonProperty(PropertyName = "Actual Rows")] - public int ActualRows { get; set; } + public decimal? ActualRows { get; set; } [JsonPropertyName("Actual Loops")] [JsonProperty(PropertyName = "Actual Loops")] - public int ActualLoops { get; set; } + public decimal? ActualLoops { get; set; } [JsonPropertyName("Output")] [JsonProperty(PropertyName = "Output")]