Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rushmore doesn't use best tag - any way to change it?
Message
From
26/02/2008 07:52:36
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
25/02/2008 19:42:46
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01296291
Message ID:
01296373
Views:
10
I have found that separating the SQL - SELECT clause into several pieces, adding one table at a time, can drastically reduce the time of the queries. In one case, from 50 seconds to 2 seconds. I tried FORCE without that much success, and have since usually split the queries.

>We have the following query:
>SELECT  Custname, wono, pno.part_no, pno.revision, to_dept_id, CountToDate, shipdate;
>  FROM  crspartno pno;
>    INNER JOIN inventor ON pno.uniq_key = inventor.int_uniq;
>    INNER JOIN crsCustsSel cust ON inventor.custno = cust.custno;
> ORDER BY custname, pno.part_no, to_dept_id;
>  INTO CURSOR crsmovedfinal READWRITE
which runs very slowly. The query plan shows
>
>Rushmore optimization level for intermediate result: none
>Rushmore optimization level for table inventor: none
>Rushmore optimization level for intermediate result: none
>Joining intermediate result and table inventor using temp index
>Joining intermediate result and intermediate result using temp index

>
>The problem is that the inventor table has an index on int_uniq but Rushmore doesn't seem to recognize it. When the query get split into two queries the optimization level improves dramatically
>SELECT  Custno, wono, pno.part_no, pno.revision, to_dept_id, CountToDate, shipdate;
>  FROM  crspartno pno;
>    INNER JOIN inventor ON pno.uniq_key = inventor.int_uniq;
>  INTO CURSOR crsmovedfinal READWRITE
>
>Rushmore optimization level for intermediate result: none
>Rushmore optimization level for table inventor: none
>Joining intermediate result and table inventor using index tag Int_Uniq
>SELECT  Custname, wono, part_no, revision, to_dept_id, CountToDate, shipdate;
>  FROM  crsmovedfinal mv;
>	    INNER JOIN crsCustsSel cust ON mv.custno = cust.custno;
> ORDER BY custname, part_no, to_dept_id;
>  INTO CURSOR crsmovedfinal READWRITE
>
>
>Rushmore optimization level for intermediate result: none
>Rushmore optimization level for intermediate result: none
>Joining intermediate result and intermediate result using temp index

>
>No matter how I re-arranged the pieces of the query, I still couldn't get the "proper" tag to be used.
>
>I've never found a construction such as
>INNER JOIN myTable ON condition USING INDEX TAGS
but is there some way to structure the query so that Rushmore will do a better job selecting which tags can be used?
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform