Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Speed Test
Message
 
 
À
04/08/2000 07:13:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00400917
Message ID:
00400924
Vues:
18
Hi Kev,
There is a grey area depending on the size of the table and the indexes available. Invoking Rushmore (SQL statement) may take longer than the equivalent xBase commands or it may not. It's something you have to run tests on continuously in order to determine what is best for a each situation.

As an aside, try making your DO WHILE ... ENDDO loop a SCAN WHILE ... ENDSCAN loop. Scan is faster and it's one less line of code.
SELECT ChildTable
IF SEEK(ParentTable.PriKey)
   SCAN WHILE ChildTable.ForKey = ParentTable.PriKey
   **** Some Code Here ****
   ENDSCAN
ENDIF
>I have been debating on child records, whether to SELECT the related records or SEEK and SKIP through them.
>
>I have always regarded the SEEK as the fastest method, but have usually run SELECT INTO CURSOR, and then SCAN the cursor.
>
>I ran a simple test and the SELECT came out quicker - can this be right.
>
>Here are my 2 methods:
>
>*** SEEK Method ***
>
>SELECT ChildTable
>IF SEEK(ParentTable.PriKey)
>DO WHILE ChildTable.ForKey = ParentTable.PriKey
>**** Some Code Here ****
>SKIP
>ENDDO
>*******************
>
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform