|
Posted by Dan Guzman on 05/05/07 13:59
> 1. Are stored procedures WITH ENCRYPTION slower than the ones without
> encryption?
The execution speed will be identical with or without encryption since the
compiled plan is used. I also ran a cursory test and found no measurable
difference compilation speed.
> 2. Should i put most restrictive conditions first or last in WHERE? In
> which order does MSSQL execute conditions? Or MSSQL determents what
> would be best and does not bother with the way i sorted conditions?
The order you specify WHERE clause predicates makes no difference. The SQL
Server optimizer will rearrange predicates as it deems necessary to maximize
performance. The biggest query performance gains are realized with indexing
and sargable expressions that SQL Server can use to generate the most
efficient plan.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Igor" <jerosimic@gmail.com> wrote in message
news:1178362395.592943.90460@q75g2000hsh.googlegroups.com...
> 1. Are stored procedures WITH ENCRYPTION slower than the ones without
> encryption?
>
> 2. Should i put most restrictive conditions first or last in WHERE? In
> which order does MSSQL execute conditions? Or MSSQL determents what
> would be best and does not bother with the way i sorted conditions?
>
> for example:
> SELECT *
> FROM [users]
> WHERE
> [user_id] = 1 AND
> [baned] = 0
>
> Is "[user_id] = 1" or "[baned] = 0" going to be executed first?
>
Navigation:
[Reply to this message]
|