Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optimised select from 2 tables
Message
From
08/06/2001 07:45:43
 
 
To
08/06/2001 07:30:02
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00516779
Message ID:
00516811
Views:
8
Hi!

I made just now following:
create table t1 with key and a character field
create table t2 with key and bb character field
index table t1 by key and a field
index table t2 by key and bb field

run a querty after populating a few testing records and SET DELETED OFF:

SELECT * ;
FROM T1 ;
LEFT OUTER JOIN T2 ;
ON T1.Key = T2.Key ;
WHERE T1.a = '12' ;
AND T2.bb = 'qwwe'

And the _Screen displays following:

Using index tag A to rushmore optimize table t1
Rushmore optimization level for table t1: full
Using index tag Bb to rushmore optimize table t2
Rushmore optimization level for table t2: full
Joining table t1 and table t2 using index tag Key

That means a full optimizationg.

What is wrong with above?

Did you made all indexes required for optimization? Do you have any filters in indexes? Filtered indexes could not be used for optimization.

HTH.

>Vlad
>
>I have tried that, but there are very few deleted records.
>
>It does optimise the query, but because it selects all of tabe1 records, and then filters on the 2nd table afterwards, it takes agaes.
>
>I could swap it around, so that the initial table is Table2, but that won't always be the case.
>
>So I'm really looking for a work-around.
>
>THanks
>Kev
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform