Query Tuning

philcart

New Member
Running Progress 9.1c on UNIX. Client Windows 2000 Server. Connecting via Merant 3.60 ODBC drivers. The database is run by a third-party and we are not able to run anything on the UNIX host. As an added bonus they only provide support for 4GL access.

I'm trying to run the following query,

Code:
SELECT led."clcode", led."cl-line"
, led."balance", led."trade-day"
FROM "PUB"."cli-led" led
INNER JOIN (
SELECT cld."clcode"
, cld."cncycode"
, MAX(cld."cl-line") as 'cl-line'
, MAX(cld."trade-day") as 'trade-day'
FROM "PUB"."cli-led" cld
GROUP BY cld."clcode", cld."cncycode"
) as Mx
ON led."clcode" = mx."clcode"
AND led."cl-line" = mx."cl-line"
AND led."cncycode" = mx."cncycode"
AND led."trade-day" = mx."trade-day"

This query works but takes over 10 minutes and returns 1.5mil rows. I'm really only interested in about a dozen rows. However, if I add any further joins and criteria, the query cancels after about 2 minutes with this error,
Code:
<eb1>Server not reachable or possible RPC error
State:S1000,Native:-20211,Origin:[MERANT][ODBC PROGRESS driver][PROGRESS]</eb1>

Are there any tools available for helping me work out what's happening with the query? Something that will allow me to see what if any indexes are being used by the query, reads, etc...

Thanks
Phill
 
Back
Top