Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is faster: insert from memvar or insert fields?
Message
From
25/07/2006 11:20:09
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01139366
Message ID:
01139734
Views:
14
>>>That's getting on my nerves :(
>>>
>>>Error: 1103
>>>LineNo: 1228
>>>Message: Invalid seek offset.
>>>Procedure: runprocess
>>>Details:
>>>StackLevel: 2
>>>LineContents: insert into load_trans_diagnosis_codes... Time spent: 43 sec.
>>>
>>>I added cEntered_User in all my insert statements, BTW.
>>>
>>>Ok, time to get another fresh set of data and re-try.
>>
>>I'd recreate my table and indexes when I get that error.
>>I don't have an idea about cEntered_user.
>>Cetin
>
>I don't think re-creating it possible. However, right now I'm copying last night backup data to my local drive. Once it's done, I'll apply recent database changes, Reindex, Repair (all through SDT), then resume my tests.
>
>cEntered_User is the field with GetUserID() as default value. I added it explicitly to all my insert commands, so it would not be calculated. Thanks again for this great idea which I'm sure would speed up this process a lot. ValidateSSN and age calculation parts were also updated since yesterday, but here I don't expect to gain very much.
>
>I haven't switched back to scatter approach suggested by John Koziol since I already took time re-writing that code and converting to insert fields...

I didn't say add explicitly. Still would be calculated, no? I meant if it's something returning an integer in sequence, then get starting value only, allocating a block of ids ahead for your insertions and directly use integers in that block. ie:
lnStartID = GetUserIDAsBlock( m.lnPreEstimatedInsertions )
lnInserted = 0
*...
userID = lnStartID + m.lnInserted
* insert ...
lnInserted = m.lnInserted + 1
I didn't mean reindex but recreate from scratch. With reindex it's likely you'd continue to get error. I don't know how SDT handles.

I still think insert style wouldn't have much impact for 4K+ or 4K+ * 16 records. One hour is simply too long for VFP. I would even think to insert them all into a new cursor with same structure, then when done do a single append from (or insert..select). Removing indexes during insert/append and recreating them after would also help.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform