471,066 Members | 1,391 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

Where conditions, Encryption

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?

May 5 '07 #1
2 2434
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" <je*******@gmail.comwrote in message
news:11*********************@q75g2000hsh.googlegro ups.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?
May 5 '07 #2

Dan Guzman wrote:
Everything as i expected. Thank you for your reply.

May 5 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

65 posts views Thread by PengYu.UT | last post: by
3 posts views Thread by Darren Clark | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.