473,802 Members | 1,986 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2585
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*******@gmai l.comwrote in message
news:11******** *************@q 75g2000hsh.goog legroups.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1714
by: | last post by:
As we're on this topic in another thread right now: Say I have a SELECT query from more than one table and with some = conditions, does it matter in what order I enter the tables in the FROM = clause and in what order the WHERE conditions appear in my query? Or = does it make any difference if I use WHERE or HAVING? (I see that MS = Access likes those HAVINGs...) Of course my tables contain (maybe very much) more than some 100 records...
3
44535
by: mheydman | last post by:
I apologize if this has been asked before- I searched google but could not find a concrete answer. I recently inherited a database whose t-sql code is written in a format that I find difficult to read (versus the format I have used for years). I have tested the queries below using the SQL Profiler, and both have identical costs. Is there any advantage of one format over the other?
10
7598
by: joshsackett | last post by:
I am starting an encryption project for my database and I'm performing some tests on decryption speed. A lot of my application queries use a LIKE parameter in the WHERE clause. To keep from changing my application I am performing all the work on the back-end; creating views, triggers and UDFs to encrypt/decrypt the data. A problem has arisen around the LIKE parameter, though. Currently: SELECT SSN, FNAME, LNAME FROM USERS WHERE LNAME...
65
3017
by: PengYu.UT | last post by:
Hi, Sometimes, I write = instead of == in if conditions by mistakes. Is there any way the gcc compiler can give me a warning? Best wishes, Peng
10
2415
by: Dica | last post by:
i've got an app that needs to connect to sql server and login with a useName/password. currently, my app saves this info in an XML file in plain text (i.e. no encryption). everytime the app is opened, the XML file is read and the userName/password used to establish the sql connection. is this the normal way of doing things, or is it smarter to save these set tings elsewhere, like the registry? if saving to XML is deemed appropriate, should...
3
1381
by: Darren Clark | last post by:
Basically i am curious as to where everyone stores there database details for ASP.NET apps? When developing controls i usually stored it in the web.config file. Then i move it to a internal private property that is only acessable from my DB classes. What other methods do people use? Encryption and then store in the webconfig? or registry? or encrypt then registry?
1
2289
by: David | last post by:
One thing that's always puzzled me about implementing encryption on remote asp.net apps is where to store the keys. The demo code indicate that you include them in a configuration file, but this would seem to defeat the purpose. If someone obtained the configuration file and they knew the encryption method, then they could decrypt your data. Storing them hard-coded in the app is just as bad, since it can be disassembled. Obfuscation...
24
8641
by: Kunal | last post by:
Hello, I need help in removing if ..else conditions inside for loops. I have used the following method but I am not sure whether it has actually helped. Below is an example to illustrate what I have used. Original code : c= 0 ; for (i=0; i<999; i++)
12
25133
by: =?ISO-8859-1?Q?Ren=E9?= | last post by:
Hi, is there a rule of thumb what is better/faster/more performant in SQL Server 2005? a) SELECT * FROM A INNER JOIN B ON B.ID = A.ID AND B.Cond1 = 1 AND B.Cond2 = 2 b) SELECT * FROM A INNER JOIN B ON B.ID = A.ID WHERE B.Cond1 = 1 AND B.Cond2 = 2
0
10538
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9115
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.