|
|  |
 |
 |
Make Operations Faster
TP041
http://www.imakenews.com/alphasoftware/j...
by John Zaleski
John Zaleski
A while back, Ira Perlow, Peter Wayne, and I were discussing append operations on the board. Ira pointed out some concepts that are well worth considering when dealing with Saved Operations on large tables.
Let’s assume you have a very large Table(A) which contains 500,000 records with 10 well-thought-out indexes to allow quick and easy access to these records (taking advantage of Lightning Query). Let’s also assume that you have defined an append operation to bring in five hundred additional records a day from Table(B). [NOTE: The term sole access will be used to denote that no other process in the system is currently using that table.]
When you append the records, if Alpha senses that it has sole access to Table(A), two things will happen.
| 1. |
Alpha will append the 500 records from Table(B) into Table(A).
|
| 2. |
Upon completion, Alpha will completely rebuild the indexes for Table(A). This can be a very time-consuming process.
|
Now let’s assume that you intentionally keep another instance of Table(A) open (for example, you open up the default form for Table(A) before running the append operation). Alpha now senses that it does not have sole access to Table(A). Here's what happens:
| 1. |
Alpha will again append the 500 records from Table(B) into Table(A).
|
| 2. |
However, with Table(A) already open, Alpha will only update the indexes for the individual records that are appended. Instead of rebuilding all the indexes for 500,000 records (10 indexes * 500,000 records = 5,000,000 pointers rebuilt), Alpha will only rebuild the indexes for the 500 records that are appended (10 * 500 = 5000 pointers rebuilt).
|
The net effect could result in a large time saving for the entire operation. The moral of the story: If you are appending a relatively small number of transaction records into a very large master table and you want it to happen as quickly as possible, keep another instance of the master table open during the append. This general behavior can also be seen when doing other Alpha operations such as Updates.
[PRINTER FRIENDLY VERSION]
|
|
|