spaghettidba / WorkloadTools

A collection of tools to collect, analyze and replay SQL Server workloads, on premises and in the cloud
MIT License
230 stars 51 forks source link

WorkloadViewer shows queries twice, with inverted stats (baseline <--> benchmark) #115

Closed CrazySwimmer closed 7 months ago

CrazySwimmer commented 2 years ago

It is the exact same workload captured in two different ways. Baseline was captured from ExtendedEventsWorkloadListener to AnalysisConsumer + WorkloadFileWriterConsumer Benchmark was captured from FileWorkloadListener to AnalysisConsumer The benchmark does not come from a replay.

The query marked in red appears only once because I stopped the benchmark analysis before it was finished.

image

CrazySwimmer commented 2 years ago

I can confirm that I get the same result even after full replays, no matter what two workloads I compare.

An interesting point I noticed is that I can select either of any two queries and the "Query Details" pane will always show only one result (i.e., not inverted). I would guess this points to a problem in how the merge is done in the "Queries" pane.

spaghettidba commented 2 years ago

Thank you for reporting this problem. Would it be possible for you to upload a copy of the analysis database? You can "anonymize" the queries but blanking the "normalized_text" and "example_text" columns in the NormalizedQueries table.

CrazySwimmer commented 2 years ago

Hi Gianluca, Apologies for the late reply. Where should I upload the analysis database?

spaghettidba commented 2 years ago

Wherever you prefer (google drive, onedrive...). If the database is small enough you can attach it to the issue by drag/drop on the comment.

CrazySwimmer commented 2 years ago

I took the liberty to anonymize databases, hosts and logins as well. One precision: this isn't the database from the screenshot above, but the "feature" of interest is still present.

Here's a ZIP containing the backup file: WorkloadAnalysis_CrazySwimmer.zip

spaghettidba commented 2 years ago

Awesome! Thank you very much for the file. I will have a look as soon as possible.