As I was explaining .... the replication system is working quite well -- except that it is slow. I checked the trigger code several times and could see no obvious reason for the problem. Each trigger deals with a different table, of course, but have exactly the same pattern. They:
1. Create and populate a record which is a copy of the updated source record.
2. Create a small "pointer" record.
3. Execute a Linux command "whoami" to get the user ID of who caused the update.
4. Create a small "tally" record used to account for records processed.
I carried-out a series of tests running a very large batch job -- each test starting with a database restore to ensure the test was against exactly the same data.
The "culprit" (to my considerable surprise) was the "whoami" command. When it was allowed to execute it doubled the execution time of the job!
I ran the test a few times to make sure -- and without a doubt -- when that command was allowed to execute it doubled to execution time.
I then made a small ABL test program that did nothing other than execute "whoami" in a loop. The loop executed 100,000 times and the result was that each execution took 6.4 Msec -- which is an "eternity" in code execution terms.
The actual instructions used are:
Code:
INPUT THROUGH VALUE("whoami") NO-ECHO.
IMPORT lc-usr.
INPUT CLOSE.
For the time-being I will suppress this section of code. When I get a chance I will see if I can find a better way to do this.
Ron.