Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update SQL performance
Message
From
17/01/2005 12:37:13
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Update SQL performance
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00977787
Message ID:
00977787
Views:
54
I'm hitting a very "interesting" performance problem...
I am trying to update records in a table based on records from another table ( or array ) and it takes forever.

The variation displayed below is inspired by code that runs lightning fast on ORACLE... ho
         Select bom  &&&& TABLE to be UPDATED
         Set Order To bom_pk    &&& UNIQUE INDEX that drives the update

*!* CREATE driving array with data 

         Select bom_pk, itemvalue, vpc_pk, xinv_pk, itemcost From TBOMUPDATE Into Array atbomupdate Order By bom_pk
         lalen=_Tally

*!* Process UPDATE's
        For iup = 1 To lalen
            Update bom ;
               set  itemvalue = atbomupdate[iup,2], ;
               vpc_pk = atbomupdate[iup,3], ;
               xinv_pk = atbomupdate[iup,4], ;
               itemcost = atbomupdate[iup,5] ;
               where bom.bom_pk = atbomupdate[iup,1]

         Endfor
The BOM table is not that big... approx 600K records, and for the above snippet ( updating about 30 records... ) it takes 20 seconds...

I have tried REPLACE... and it's WAY.. worse.
Any ideea would be appreciated... thanks in advance, alex
Next
Reply
Map
View

Click here to load this message in the networking platform