I've recently been debugging a very slow (2-3minutes) retrieval and started doing some tracing of my own. 3 DB transaction objects, TRACE XXX on all 3 of them, also using SQL tracing features too.
Each Transaction object can have a different file assigned, and when using TRACE in the DBMS, it should prompt for the filename for each connection (it does for me), so you can have each trace end up in a different file.
Here's how I connect to the DB:
if ib_dbtrace then
sqlca.DbParm += "ConnectOption='SQL_DRIVER_CONNECT,SQL_DRIVER_NOPROMPT;SQL_OPT_TRACE,SQL_OPT_TRACE_ON;SQL_OPT_TRACEFILE,c:\temp\odbctrace_sqlca.log'"
sqlca.dbms="TRACE " + GetSettingString(gs_IniFile, "Database", "DBMS", "ODBC")
else
sqlca.DbParm += "ConnectOption='SQL_DRIVER_CONNECT,SQL_DRIVER_NOPROMPT'"
sqlca.dbms=GetSettingString(gs_IniFile, "Database", "DBMS", "ODBC")
end if
Further on in the code we replace _sqlca with the appropriate transaction name in the DBParm to differentiate the trace files.
trans_main.DbParm = srchrepl(sqlca.dbparm, "_sqlca", "_trans_main")
From this, I've been able to see what's going on through each part of the system, and can compare retrieval times quite easily. (though it still hasn't helped me solve the speed issue yet)