In trying to find the "demons" in this legacy VFP app (shared/used by both desktop and internet/website users), I find there's a lot of APPEND BLANKS everywhere followed by an immediate REPLACE (and sometimes more than 1).  Here's a sample of my findings:

 SELECT notes
 APPEND BLANK
 REPLACE notes.id WITH order.invoice
 REPLACE notes.dtg WITH DATETIME()
 LOCAL lnnotes_id
 lnnotes_id = notes.notes_id
 = TABLEUPDATE(.T.)
 GOTO BOTTOM
 = SEEK(lnnotes_id, 'notes', 'notes_id')
 SET ORDER TO ID
 thisform.pgf1.page5.grdnotes.coldetail.setfocus()

Now, 1st, I'd say "switch this over to explicit INSERT INTO MyTable (ID, Dtg) VALUES (order.invoice,datetime())"   Also, not sure why they're go to the bottom and then reposition the record pointer immediately afterwards.  That's wasted moves/cycles, imo, although perhaps minuscule.

If the user did NOT have table buffering in place, I can see a bigger knock against this approach because with every update, the table's CDX indexes would all have to be updated (if those fields were involved).  The backend table's CDX file isn't updated on changes to the buffered cursor.

Question:  if you update fields that are indexed, I know the index file has to update to reflect those changes.  If you update fields that are NOT IN ANY INDEXES, there's no update needed for the CDX then...right?

Any other tips?


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to