Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query can not be optimized?
Message
 
 
To
03/10/2006 11:32:14
Thomas Ganss (Online)
Main Trend
Frankfurt, Germany
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01158559
Message ID:
01158940
Views:
33
>as the where clause doesn't compare to a constant value but a field in the table to be joined I don't believe it can be optimized by rushmore: the optimizer would have to "understand" the "distinctness" of cl_ref in the subselect. ***If*** that was not the case, how should a record in p be flagged which has cl_dob> AdjRefDate of Recno()=1 but cl_dob< AdjRefDate of Recno()=15 ? But since cl_ref is unique, perhaps a compound index could be used to bisect p for each record in the sub-select. Maybe Aleksey will chime in, but I think this could be one of the situations where hand-optimization can make a difference. One of the things I'ld try would be a double scan loop with r in the outer loop jumping over all the records in person with the same cl_Ref but not fitting the date criteria. The effectiveness should grow the smaller reccount() is in the grouped sub-select, giving each r.cl_Ref the possibility of dicarding many records on p.cl_dob without actually checking them, as I guess the
>SQL has to do.

Hi Thomas,

My intention was to avoid double JOIN for the person and referral tables reported by SYS(3054,11) for previous query and see if it improver performance.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform