article thumbnail

Simple Parameterization and Trivial Plans — Part 2

SQL Performance

Simple parameterization has a number of quirks in this area, which can result in more parameterized plans being cached than expected, or finding different results compared with the unparameterized version. For the time being, let’s look at some examples using the Stack Overflow 2010 database on SQL Server 2019 CU 14. Users AS U.

Cache 90
article thumbnail

Simple Parameterization and Trivial Plans — Part 1

SQL Performance

This series doesn’t dwell too long on the basics but concentrates on less well-known aspects likely to trip up even the most experienced database professionals. In this first part, after a quick introduction, I look at the effects of simple parameterization on the plan cache. ALTER DATABASE SCOPED CONFIGURATION. sp_configure.

Cache 61
Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Trending Sources

article thumbnail

Simple Parameterization and Trivial Plans — Part 3

SQL Performance

Let’s look at some examples using the Stack Overflow 2010 database on SQL Server 2019 CU 14, with database compatibility set to 150. It’s important to remember the plan must be cached. Requesting an estimated plan from SSMS does not cache the plan produced (since SQL Server 2012). Dynamic Management Objects.

Cache 58
article thumbnail

Simple Parameterization and Trivial Plans — Part 5

SQL Performance

As in previous parts, code examples use the Stack Overflow 2010 database on SQL Server 2019 CU 16 with the following additional nonclustered index: CREATE INDEX [ IX dbo. This could be unsafe in case-sensitive databases. Let’s look at the plan cache: SELECT. Users Reputation ( DisplayName ) ] ON dbo.

Cache 54
article thumbnail

Simple Parameterization and Trivial Plans — Part 4

SQL Performance

As in previous parts, most code examples use the Stack Overflow 2010 database on SQL Server 2019 CU 16 with the following additional nonclustered index: CREATE INDEX [ IX dbo. Names of tables and columns haven’t been resolved to database objects yet, and no type information is available. Let’s look at the plan cache: SELECT.

Cache 55
article thumbnail

Expanding the Cloud - Introducing Amazon ElastiCache - All Things.

All Things Distributed

Today AWS has launched Amazon ElastiCache , a new service that makes it easy to add distributed in-memory caching to any application. Amazon ElastiCache handles the complexity of creating, scaling and managing an in-memory cache to free up brainpower for more differentiating activities. Amazon DynamoDB â?? Expanding the Cloud â??

Cloud 117
article thumbnail

How Parallel Plans Start Up – Part 1

SQL Performance

I used the public Stack Overflow 2013 database ( download details ). The desired plan shape can also be obtained against the smaller Stack Overflow 2010 data set if that is more convenient. See Myth: SQL Server Caches a Serial Plan with every Parallel Plan for details. Creating cached expression values ( runtime constants ).

Cache 98