Re: Not calling CLOSE when finished.
Posted in 1994
> Informix also told us that we should FREE the cursor after closing > it. I'm not sure how this, or the CLOSEing (or not) of cursors > affects performance. Any ideas anyone? FREE releases all the memory which a cursor (and its associated engine statement) had allocated, eg. the space to hold the Active Set. CLOSE really only disables the cursor. The benefit of FREE is that it stops your program hogging memory, which perhaps you or someone else on the system could have made good use of. The cost is that, before you can re-OPEN the same cursor, Informix has got to parse the query again. (Implicitly or explicitly; ie. If you PREPAREd the query, you'd have to re-PREPARE it) Soooo... if memory's tight on your system, FREE might give you some benefit; but if the cursor's one you are continually re-opening, the need to re-parse will slow your processn down. I usually use FREE only for cursors I'm done with for a while, or which I was going to re-PREPARE anyway. (For example, because they are based on a CONSTRUCT). -Andy Kent-