Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
This is a surprise
Message
From
27/02/2000 22:34:07
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
This is a surprise
Miscellaneous
Thread ID:
00338270
Message ID:
00338270
Views:
54
Address is a table with 400,000 records indexed on Addrnum
Cons is a table of 120,000 contacts indexed on CCust
Both have tags on DELETED()

The query...
SELECT A.* FROM Address A, Cons C ;
  WHERE C.CCust = "GREATLA2" ;
  AND C.PAddrnum = A.Addrnum ;
UNION SELECT A.* FROM Address A, Cons C ;
  WHERE C.CCust = "GREATLA2" ;
  AND C.Addrnum = A.Addrnum
runs about 50 times faster than...
SELECT A.* FROM Address A, Cons C ;
   WHERE C.CCust = "GREATLA2" ;
   AND (C.Addrnum = A.Addrnum OR C.PAddrnum = A.Addrnum)
Both queries show as fully optimized with SYS(3054,1), both return the same result set.
Strange uh!
Next
Reply
Map
View

Click here to load this message in the networking platform