Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very slow VFP SQL Update
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Very slow VFP SQL Update
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01085361
Message ID:
01085361
Views:
60
The folowing two table updates where tested with the bsmemo table open at another PC but with no locks.

The c_memo and bsmemo tables have identical structures of:
k_seqno i(4), k_memo i(4), textln c(65)
and are indexed on k_seqno and k_memo.
(Note that k_memo is not used in the updates.)

c_memo has 3 records, bsmemo has 9,000 records.

I tried several ways with the SQL Update and nothing helped. It appears that the SQL Update is not using the index at all. Using the Old Scan/Replace takes .013 seconds. The SQL Update takes 16 seconds.
TIA, John.
*
* This Scan/Replace takes .013 seconds
* ---------------------------------
select 0
use bsmemo order k_seqno
select 0
use jmemo alias c_memo exclusive
*
msec = seconds()
*
select c_memo
scan
  select bsmemo
  if seek(c_memo.k_seqno)
    replace textln with c_memo.textln
  endif
endscan
*
? seconds() - msec
*
*
* This SQL Update takes 16 seconds
* ---------------------------------
msec = seconds()
*
update bsmemo set ;
textln = c_memo.textln ;
from c_memo ;
where c_memo.k_seqno = bsmemo.k_seqno ;
and c_memo.updtflag = 'U'
*
? seconds() - msec
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Next
Reply
Map
View

Click here to load this message in the networking platform