Consultor Eletrônico



Kbase P11804: Code seems to be ultra slow on 9.1D
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   29/11/2003
Status: Unverified

FACT(s) (Environment):

Caldera Open UNIX/SCO UnixWare

FACT(s) (Environment):

Progress 7.3x

FACT(s) (Environment):

Progress 9.1D

SYMPTOM(s):

Code which has worked for years seems to be ultra slow on 9.1d when not using USE-INDEX.

The following program takes about 2-3 minutes with use-index clauses and > 2 hours without. However, used to be 2-3 minutes without use-index clauses. If you take out the bys then it is fast without the use-index clauses.

/*

Problem: Code has worked for years. Seems to be ultra slow on 9.1d. Not using index.

Testing: The following program takes about 2-3 minutes with use-index clauses and > 2 hours without. However, used to be 2-3 minutes without use-index clauses. If you take out the bys then it is fast without the use-index clauses.
*/

def var cnt as integer no-undo.
def var junk as integer no-undo.

junk = etime(yes).

for each account where (account.co-no = 1) no-lock,
each openheader where (openheader.co-no = 1) and
(openheader.oi-acct-no = account.acct-no) and
(openheader.oi-status = "C") and
(openheader.pub-code = "FMO")
/*
use-index openx1
*/
no-lock,

each openitem where openitem.co-no = openheader.co-no and
openitem.oi-status = openheader.oi-status and
openitem.pub-code = openheader.pub-code and
openitem.oi-refno = openheader.oi-refno and
openitem.oi-date <= 10/01/2002
/*
use-index itemx1
*/
no-lock

break by account.acct-no
by openheader.pub-code
by openheader.acct-no
by openitem.oi-refno
by openitem.oi-date
:

cnt = cnt + 1.

end.


display etime / 1000 / 60 cnt.

CHANGE:

Upgraded to 9.1D

CAUSE:

Unknown. This issue could not be duplicated.

FIX:

Use the USE-INDEX option.