Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Improving sluggish SQL
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00306158
Message ID:
00306370
Vues:
35
>>>>Or Just turn buffering on for table1 and do a tablerevert() within a begin/end transaction so that no changes get saved back to the table.
>>>
>>>I'm not sure TABLEREVERT() would be any faster than recall all.
>>
>>It should be much faster, since it simply involves throwing out the local buffers; no changes have actually been written to the table. If the deletions are really written to the table, then you have to actually rewrite the records to remove the deletion mark.
>
>Okay, here's the results of some testing in a fairly simple situation:
>
>1) The simple SELECT...NOT IN takes about 220 seconds
>
>2) The DELETE FROM... by itself takes about 210 seconds, though optimized.
>
>3) The additional SELECT to use with the DELETE FROM takes about 30 seconds.
>

And what about the RECALL ALL vs optimistic table buffering and TABLEREVERT()? That's where I expected to see a significant difference in performance.

>So, to compare, we have the fastest so far by just doing the unoptimized NOT IN method. Whatever way the SQL handles it internally, it is pretty fast for the difficult job it has to do. Maybe I won't complain so much now.
>
>The reason, I assume, that the DELETE doesn't help much is that these are unique keys, and every record must be checked and potentially marked, and even with an index to help, it's not of enough benefit. Probably there's a fair overhead on the marking of DELETEDs, also.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform