RSA Admin

SQL statement syntax order of statements

Discussion created by RSA Admin Employee on Sep 23, 2009
Latest reply on Jan 4, 2010 by RSA Admin

Help me understand the way enVision compiles reports.


Is there a way to optimze the syntax in a SQL statement for reports?  Here is an example of what I mean:


(1)  MessageID = 'event' AND (username = 'bob' OR eventuser = 'bob')


(2)  (username = 'bob' OR eventuser = 'bob') AND MessageID = 'event'


Does enVision first go through the IPDB when it compiles the report and look for the first condition, i.e., MessageID...effectively grabbing 'event' that equals the critera and then uses the other conditions of username or eventuser?


If that is the case...then the second query would be quicker - go through the IPDB and grab the username/eventuser of 'bob' and then narrow down the messageID event I am looking for.


I hope this makes sense...but effectively I'm trying to determine if the way I write my SQL statements makes a difference in how fast and efficiently I can generate reports.  Any thoughts?  If this is the case, could you provide some general rules to follow?  Thanks!