Anonymous 2148
Hi! Github issue template told me to go wander so here I am. sp_QuickieStore reports 20 executions for query_id / plan_id in the interval. Query Store "tracking query" report shows like somewhere around 80 execs for same query_id / plan_id. Does SP show only the last interval from Query Store (making param @start_date useless in that case)? Where does SP get first and last exec times then?
![Screenshot_1.png](/image?hash=839d7f8b872e9fce4d994bc58365b5795b93579eaa13484ea4e80ded46273ac6)
![Screenshot_2.png](/image?hash=36bb64c991580cbf06f3ab173c1856efb10208f91ca1c94f5912f4de999cf54a)
Thx!
Top Answer
meme
Hi there!

Thanks for using sp_QuickieStore.

The reason for the discrepancy is likely because the query that executes to get a working set of plans to work on only gets the `TOP (N)` plans with an `execution_type = 0` from `query_store_runtime_stats`. The default is 10. That's the same place that the `@start_date` and `@end_date` parameters are applied as well.

It may help to use a bigger value for the `@top` parameter, since it appears multiple plans are present for the statements and perhaps not all of them make it into the initial data set.

There's also a possibility that a built-in default for the `@plans_top` value -- 1 if `@include_plan_ids` is specified and 10 if not -- may be artificially limiting the plans that make it into the final result. 

Here's what I'd suggest:

1. Try a larger value for the `@top` parameter
2. If that doesn't work, crack open the proc and ctrl+f for `@plans_top`, then change the `case` expression that controls the value to something like:

```
@plans_top =   
    CASE
        WHEN @include_plan_ids IS NULL
        THEN 1
        ELSE 9223372036854775807
    END,
```

Let me know how that goes!

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.