General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SQL optimization trouble
Hi All,
If I execute the following line, the result (a single recod in this case but now always) comes up quickly (<1 second):
***************
SELECT * FROM Code WHERE kCodeType="{09D0D53C-3F5A-48B0-8B87-BB740565DA0A}" AND cValue="Y "
***************
If I execute the following line, the result comes up fairly quickly (1.2 second). Note the GUID is the result of the above query.:
***************
SELECT * from voter WHERE kVoter="{C9B43423-4248-4E55-8A05-6F81939FBD50}"
***************
If I execute the following line, the query runs EXTREMELY slow and all but locks up the computer:
***************
SELECT * from Voter WHERE kVoter in (Select kVoter FROM Code WHERE kCodeType="{09D0D53C-3F5A-48B0-8B87-BB740565DA0A}" AND cValue="Y ")
***************
What am I doing wrong?
Aloha,
James
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only