I developed somewhat complicated stored procedure (several CTEs, three calls to table-valued functions with CROSS APPLY)
Executing this procedure with SQL Server 2019 Developer’s edition runs for 7 seconds.
Executing this procedure with SQL Server Express edition took so long that I had to abort it; however, after installing CU4 (KB4548597) the execution took only 14 seconds.
Just for the sake of experiment I upgraded SQL Server to Standard edition; executing of this very same procedure now takes 6 hours 45 minutes!!
Test PC is 6-core i5 8500 6GHz
Query store configuration:
ALTERDATABASE [my_db]
SETQUERY_STORE=ON
(
OPERATION_MODE=READ_WRITE,
CLEANUP_POLICY=(STALE_QUERY_THRESHOLD_DAYS= 0),
DATA_FLUSH_INTERVAL_SECONDS= 900,
QUERY_CAPTURE_MODE=ALL,
MAX_STORAGE_SIZE_MB= 1000,
INTERVAL_LENGTH_MINUTES= 60,
SIZE_BASED_CLEANUP_MODE=OFF,
MAX_PLANS_PER_QUERY= 200,
WAIT_STATS_CAPTURE_MODE =ON
);
Surely, I’m doing something wrong … paid Standard edition can’t perform worse than the free Express one. Did upgrading the edition undo the positive effect of CU4? I attempted to re-apply CU4 but it was rejected.
Thank you,
Eugene