Skip to content
This repository was archived by the owner on Dec 23, 2017. It is now read-only.
This repository was archived by the owner on Dec 23, 2017. It is now read-only.

Value length of string parameters defaults to explicit causing cache bloat. #50

@aidapsibr

Description

@aidapsibr

The parameter sizes on string parameters are variable based on the length of the string that is being sent to SQL. For instance, if I perform a dynamic query with a string parameter, the field definition that is added to the SQL string will be the actual length of the string.

pasted1

Because of this behavior, a procedure plan will be created and cached for every possible length of the string, and every combination when more than one parameter is sent. This could be argued as intended behavior so that the plan cache is accurate to the length of string being queried. It could equally be argued that it bloats the cache, requires a compilation per combination of string length, and creates a good potential for a corrupt plan that hits on 11 character length but not 10 characters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions