Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can this one to many SQL line be made faster?
Message
From
30/01/2004 06:09:36
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
 
 
To
30/01/2004 05:38:38
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00871681
Message ID:
00872226
Views:
18
Hi
You're right
If a query with a small result set is not based on a good selectivity but a full table scan and a grouping operation , it cannot be fast, IMO.

A variant could be:
Select DISTINCT b.cfk1, b.cfk2, a.ctype;
	FROM  vcf!many b ;
	INNER Join vcf!one a ON  b.cfk1 = a.cid;
	WHERE (b.namount1<>0 OR b.namount2<>0 OR b.namount3<>0)=.T. and a.ctype In ("F","8") 
If exists an index on (b.namount1<>0 OR b.namount2<>0 OR b.namount3<>0), this could be fast, if has a good selectivity, but I don't know if results are correct




>Dorin,
>
>not neccesarily:
>the selectivity could be masked by the group by!
>
>regards,
>
>thomas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform