Skip to content

Parameter substitution increases plan cache bloat #163

@tivivi63

Description

@tivivi63

SQLQueryStress is a great tool, really. But I noticed that generating fake parameter values from a query tends to create multiple plan cache entries for the same exact command text, when it comes to nvarchar command parameter types (that is obviously not a problem with integer-types parameters).

The risk here is to bloat plan cache when param substitution query return a ton of different-length values. In my example, "random" parameter generator consists in querying a name from a users table and this created 14 different plans with the same statement, mapping name length occurrence natural distribution to execution count.
image

In the UI, I can't see any way to customise inferred-from-query parameter type, automatically set to nvarchar where expected type is nvarchar(32) :
image

Any idea how to work around this situation?
Thanks,

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions