Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Performance switched with parameter
Message
From
25/09/2014 11:36:28
 
 
To
25/09/2014 09:14:12
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Microsoft SQL Server
Category:
Indexing
Environment versions
SQL Server:
SQL Server 2012
Application:
Web
Miscellaneous
Thread ID:
01607903
Message ID:
01608269
Views:
37
>If you create a where like
>
> (@MinDate is null OR @MinDate < = Date) and
> (@MaxDate is null OR @MaxDate > = Date) and
> (@MinAmount is null OR @MinAmount > = Amount) and
>
>SQL is doing a lot of extra work internally. If you construct the query dynamically so that in the case where @MinAmount is not passed you execute
>
> (@MinDate is null OR @MinDate < = Date) and
> (@MaxDate is null OR @MaxDate > = Date)
>
>The optimizer will not waste time even thinking about MinAmount. :)

You lost me here. I am trying to find the reference where I have to make an adjustment. Also, putting the parameter to left is highly confusing.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform