General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Hi,
I want to ask something about rushmore in VFP6.0
I tried 2 methods to join 2 tables
1. select A.*,B.* from A inner join B on A.key1=B.key1 and A.key2=B.key2 where A.key1=constantA
2. select A.*,B.* from A inner join B on A.key2=B.key2 where A.key1=ConstantA and B.key1=ConstantA
and found the time taken was different! SQL 2 was much faster than SQL 1.
All fields included in the condition was indexed. I used sys(3054) to check, and found that SQL 2 used temp index and SQL1 used key2 as index. Could anybody tell me why?
TIA.
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