Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rushmore does not use index
Message
De
25/12/2007 10:45:27
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
24/12/2007 19:51:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01277031
Message ID:
01277434
Vues:
27
One thing I would like to know is why are you using non-structural CDXs? Build the tags into the structural cdx. It doesn't matter how many tags are in it. Contrary to the beliefs of some, the entire CDX file is not copied from the server to the pc unless you do a query that involves every tag.


>Hi Sergey,
>
>Providing the CREATE and INDEX statements is a bit involved as they are built on the fly.
>
>I have managed to get Rushmore to fully optimize with this table in my sample program as follows:
>
>
>USE PAGE.DBF INDEX PAGEI.CDX ORDER PAGERNAME ALIAS OPENDIR
>
>SELECT PAGERNAME, PAGERTYPE, PAGERATTN, PAGERSTAT, PAGERSTATD, PAGERFWDNU, PAGERFWDNA, PAGERGROUP, PAGERIVR, ATTNUSRDEF FROM OPENDIR INTO ARRAY dirArrayLocal WHERE UPPER(PAGERNAME) = "MYNAMEHERE"
>
>
>However, with my application, the same (?!) logic does not optimize.
>Differences between the two programs that come to mind include:
>
>1. The production app opens many tables.
>2. The PA code to do the USE and SQL SELECT is in an in-process COM server
> dll.
>3. The USE and the SELECT are done in different calls to the dll.
> The USE is done during a call to an init method.
> The SELECT is done later in another call.
>
>
>>Hi Howard,
>>
>>You didn't provide most important piece of information, your table. Can you post CREATE TABLE and INDEX statements that we can run your code?
>>When I use table created as follow, I got Full optimization for a query
>>
>>CREATE TABLE Page ( PAGERNAME  C(20))
>>INDEX ON PAGERNAME TAG PAGERNAME
>>...
>>Using index tag Pagername to rushmore optimize table opendir
>>Rushmore optimization level for table opendir: full
>>
>>
>>>I will try this, but meanwhile I have simplified things and am wondering if anything in my process is the problem. Here's some sample code.
>>>I've been trying structural and non-structural index files, playing with ordering commands, selecting or not selecting the alias, etc.
>>>The only thing that varies is that if DELETED is set ON it will use the _DELETED index key.
>>>
>>>
>>>
>>>
>>>LOCAL ARRAY dirArrayLocal[1]
>>>LOCAL m.showrushmore
>>>
>>>* Diagnostic to verify SQL optimization.
>>>SYS(3054, 1, "showRushmore")
>>>
>>>SET DEFAULT TO z:\xx\xxdb
>>>SET OPTIMIZE ON
>>>SET DELETED OFF
>>>
>>>TRY
>>>  *USE PAGE.DBF INDEX PAGEI.CDX ORDER PAGERNAME ALIAS OPENDIR
>>>  USE PAGE.DBF ORDER PAGERNAME ALIAS OPENDIR
>>>
>>>*!*    SELECT OPENDIR
>>>*!*    SET ORDER TO PAGERNAME
>>>
>>>  *SELECT TOP 1 PAGERNAME, PAGERTYPE, PAGERATTN, PAGERSTAT, PAGERSTATD, PAGERFWDNU, PAGERFWDNA, PAGERGROUP, PAGERIVR, ATTNUSRDEF
>> FROM OPENDIR INTO ARRAY dirArrayLocal WHERE PAGERNAME = "MYNAMEHERE" ORDER BY PAGERNAME
>>>  SELECT TOP 1 PAGERNAME FROM OPENDIR INTO ARRAY dirArrayLocal
>>WHERE PAGERNAME = "MYNAMEHERE" ORDER BY PAGERNAME
>>>  ? _TALLY
>>>  ? showrushmore
>>>
>>>  UPDATE openDir SET PAGERSTAT = "mystatushere",PAGERSTATD = "",PAGERFWDNU = "",PAGERFWDNU = "",PAGERFWDNA = ""
>>WHERE PAGERNAME = "MYNAMEHERE"
>>>  ? _TALLY
>>>  ? showrushmore
>>>
>>>CATCH TO oErr
>>>    ? ( "Program Error: " + ALLTRIM(STR(oErr.ERRORNO)) ;
>>>      + CHR(13) + CHR(10)  + "             " + oErr.MESSAGE ;
>>>      + CHR(13) + CHR(10)  + "             at line " + ALLTRIM(STR(oErr.LINENO)) ;
>>>      + CHR(13) + CHR(10)  + "             in " + oErr.PROCEDURE )
>>>ENDTRY
>>>
>>>CLOSE DATABASES
>>>
>>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform