-- capture-workload-windows.sql output, database SalesDB
-- Baseline: Mon 2026-10-05 09:00-10:00 +13:00    Current: Tue 2026-10-06 09:00-10:00 +13:00
-- Part 2 was run on Monday at 08:55 (baseline) and on Tuesday at 08:55 (current)
-- Part 3 wait figures below are deltas between snapshots taken at each window's start and end

-- Part 1: Query Store, baseline vs current, by query_hash
query_hash          presence       b_execs  c_execs  b_avg_ms  c_avg_ms  b_max_ms  c_max_ms  b_cpu_ms  c_cpu_ms  b_reads  c_reads  b_execs_min  c_execs_min  sample_text
0x1A2B3C4D5E6F7081  both            12400    12950      18.4      61.2       240       910      15.1      52.8     1240     9860       206.67       215.83  SELECT o.OrderId, o.Total FROM dbo.Orders o WHERE o.CustomerId = @p1 AND o.Status = @p2
0x3C4D5E6F70819203  both              880      910     210.0     690.0      1900      4100     180.0     610.0    22000    24300        14.67        15.17  EXEC dbo.usp_SalesByRegion @Region = @p1, @From = @p2
0x2B3C4D5E6F708192  both             3100     3050      42.0     118.5       390      2850      38.0      41.2     3400     3520        51.67        50.83  UPDATE dbo.Inventory SET Qty = Qty - @p1 WHERE Sku = @p2
0x5E6F708192031425  current only        0      140                2100.0                3400                1880.0             410000         0.00         2.33  EXEC dbo.usp_ReconcileLedger @BatchId = @p1
0x92031425364F5A6B  both             1800     1750      95.0     160.0       610       980      80.0     150.0     8000    14500        30.00        29.17  SELECT c.CustomerId, SUM(l.Amount) FROM dbo.Ledger l JOIN dbo.Customers c ON ...
0x4D5E6F7081920314  both            45000    96000       1.9       2.0        30        28       1.6       1.7       12       12       750.00      1600.00  SELECT p.Price FROM dbo.Prices p WHERE p.Sku = @p1
0x8192031425364F5A  both            22000    21700       6.1       6.4        80        95       5.0       5.2      310      320       366.67       361.67  SELECT TOP (20) * FROM dbo.Notifications WHERE UserId = @p1 ORDER BY CreatedAt DESC
0xA31425364F5A6B7C  both             9400     9300      11.0      11.3       150       160       9.0       9.2      880      890       156.67       155.00  EXEC dbo.usp_GetCart @UserId = @p1
0x708192031425364F  both             5200     5150      25.0      14.8       300       190      20.0      11.0     2100      900        86.67        85.83  SELECT s.ShipmentId FROM dbo.Shipments s WHERE s.TrackingNo = @p1
0x6F70819203142536  baseline only      60        0    1500.0                2900                1320.0             380000                1.00         0.00  EXEC dbo.usp_ExportDailyOrders @Date = @p1

-- Window lengths in minutes
baseline_minutes  current_minutes
60                60

-- Query Store state
actual_state_desc  query_capture_mode_desc  interval_length_minutes
READ_WRITE         ALL                      60

-- Part 2a: server properties and capacity
side      product_version  product_level  product_update_level  edition                       cpu_count  physical_memory_kb
baseline  16.0.4125.3      RTM            CU12                  Enterprise Edition (64-bit)   16         134217728
current   16.0.4135.4      RTM            CU14                  Enterprise Edition (64-bit)   16         134217728

-- Part 2b: sys.configurations value_in_use (rows that differ, plus two that do not)
name                              baseline  current
cost threshold for parallelism    50        5
max degree of parallelism         8         8
max server memory (MB)            114688    114688

-- Part 2c: database options (SalesDB)
setting                          baseline  current
compatibility_level              140       160
is_read_committed_snapshot_on    0         0
is_auto_update_stats_on          1         1
is_parameterization_forced       0         0

-- Part 2d: database-scoped configurations (rows that differ, plus two that do not)
name                              baseline  current
LEGACY_CARDINALITY_ESTIMATION     0         0
MAXDOP                            0         0

-- Part 3: wait time deltas over each 60-minute window (ms)
wait_type             baseline_ms  current_ms
PAGEIOLATCH_SH             120960      391680
CXPACKET + CXCONSUMER       69120      224640
LCK_M_U                     51840      264960
SOS_SCHEDULER_YIELD         46080      115200
WRITELOG                    28800       34560
