Informix: ESQL/C DESCRIBE OUTPUT much slower than simple DESCRIBE for an UPDATE statement
Posted in 2026
Topics: Performance & Tuning, SQL Development & Query Writing, Stored Procedures & SPL, Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL
Hi all, A customer reported a performance issue, when performing a ESQL/C PREPARE + DESCRIBE OUTPUT + EXECUTE in a long loop. Yes, best practice is to do the PREPARE + DESCRIBE outside the loop, but the code cannot be changed (it's static SQL in .4gl code) We have identified that DESCRIBE OUTPUT is the cause: When converting to a simple DESCRIBE the performances are back. Our code is doing the DESCRIBE OUTPUT on any kind of SQL statement (can be a SELECT, UPDATE, EXECUTE FUNCTION, anything) We do this to identify the SQL statement type. The customer sample is using an UPDATE statement inside the long loop. Can it be that ESQL/C gets confused when performing a DESCRIBE OUTPUT on an UPDATE (which does not produce a result set?) Any clue why DESCRIBE OUTPUT is slow on an UPDATE? Bug or expected? We found a solution: Go back to: EXEC SQL DESCRIBE :mystmt INTO mysqlda; Then check the statement type (sqlca.sqlcode), and ignore/free the produced sqlda, when it's not a SELECT or stored procedure execution (SQ_EXECPROC 56) However, it would be interesting to understand why DESCRIBE OUTPUT is so slow (maybe a bug?) Side note: SQ_SELECT=2 is useless because a DESCRIBE returns sqlca.sqlcode=0 for a SELECT statement type. BR, Seb You are subscribed to "Informix" as paul.cdi@oninit.com. To change your subscriptions, go to http://community.ibm.com/community/user/preferences?section=Subscriptions. To unsubscribe from this community discussion, go to [link removed]