Kbase P186437: Creating 10000 records using ABL through the Dataserver takes about a minute.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  4/26/2011 |
|
Status: Unverified
SYMPTOM(s):
Creating 10000 records using ABL through the Dataserver takes about a minute.
ABL code run:
* Progress 4gl insert code (50 secs per 10,000 inserts */
DEF VAR cnt AS INT NO-UNDO.
DEF VAR stime AS INT NO-UNDO.
stime = TIME.
REPEAT cnt = 1 TO 100000:
CREATE table.
ASSIGN field = string(cnt).
IF cnt MOD 10000 = 0 THEN DO:
PAUSE 0.
DISP cnt STRING(TIME - stime,"HH:MM:SS").
Stime = time.
END.
END.
No error messages
Adding a RELEASE statement from right after DO block for 10000 records check speeds up the creation of records fourfold
FACT(s) (Environment):
Running the equivalent code with Oracle SQLPlus takes two seconds.
All Supported Operating Systems
OpenEdge 10.1C
CAUSE:
There is no known cause at this time.
FIX:
Two workarounds are:
1. Rewrite the ABL to add a RELEASE statement from right after the DO block for 10000 record check.
It is still one insert/commit to Oracle at a time but is sending more records to Oracle as RELEASE is put on the DO block as shown in the example below.
The RELEASE statement will flush the buffer to Oracle and Oracle will still hold it until the end of the transaction.
Code BEFORE:
DEF VAR cnt AS INT NO-UNDO.
DEF VAR stime AS INT NO-UNDO.
stime = TIME.
REPEAT cnt = 1 TO 100000:
CREATE table.
ASSIGN field = string(cnt).
IF cnt MOD 10000 = 0 THEN DO:
PAUSE 0.
DISP cnt STRING(TIME - stime,"HH:MM:SS").
Stime = time.
END.
END.
Code AFTER:
DEF VAR cnt AS INT NO-UNDO.
DEF VAR stime AS INT NO-UNDO.
stime = TIME.
REPEAT cnt = 1 TO 100000:
CREATE table.
ASSIGN field = string(cnt).
IF cnt MOD 10000 = 0 THEN DO:
RELEASE table.
PAUSE 0.
DISP cnt STRING(TIME - stime,"HH:MM:SS").
Stime = time.
END.
END.
2. Change the code to do a bulk insert using Dataserver.