Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rushmore Optimization - Or so I thought!
Message
 
 
To
31/10/2003 18:17:18
Todd Cottengim
Alpine Land Information Services
Redding, California, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00845268
Message ID:
00845269
Views:
14
This message has been marked as the solution to the initial question of the thread.
Hi Todd,

You can try
* JOIN
SELECT cr.plot_id ;
	FROM crzplots cr ;
	JOIN  imsfilter ON linkfield = cr.plot_id ;
	INTO CURSOR cPlots

* Correlated subquery
SELECT plot_id ;
	FROM crzplots ;
	WHERE EXISTS (SELECT *  FROM imsfilter WHERE linkfield = plot_id) ;
	INTO CURSOR cPlots
>Having never checked, I thought the following SQL was Rushmore optimized.
>This SQL is highly simplified and the actual SQL included fields not seen here. The results are the same though.
>SELECT plot_id ;
>  FROM crzplots ;
>  WHERE plot_id in (SELECT linkfield FROM imsfilter) ;
>  INTO CURSOR cPlots
>Given that the table crzplots has a field called plot_id and it is indexed and the same for the table imsfilter with the field linkfield.
>
>As crzpltos grew, the SQL was taking longer and longer. Looking throught the threads in UT, I noticed several threads refere to SYS(3054). I tried it and was told that the optimization level for both tables was none.
>
>Can this SQL be optimized. Please keep in mind that there are other fields in crzplots. I have deleted the extra fields for clarity. Secondly, crzplots is running about 1 million records and imsfilter can be any number between 1 and RECC("crzplots").
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform