Re: Set explain utility
Posted in 1997
Hi Roger, > DEC's old Rdb/VMS product did this and it was real handy. > I'd also like to know about such a utility. > > By the way, could you get the same SET EXPLAIN results > if you wrote an ESQL/C program that does the following? > > - reads a SELECT statement from stdin > - executes a SET EXPLAIN ON statement > - PREPAREs the SELECT statement > - DECLAREs a cursor for the prepared SELECT > - OPENs the cursor > - exits > you're right. You will get the result from SET EXPLAIN if you simply pass the complete SQL-statement through PREPARE. The Informix optimizer will optimize your query if you do NOT enter any question-marks inside the prepared statement. There's no need to declare a cursor or anything else. Therefore I think, you do not need a tool. The only thing you need is ESQL/C or 4GL or NewEra. Bye Stefan