Re: Benefits of cursors?
Posted in 1994
> Heinrich Seebauer (heinrich@castor.mai.de) wrote: > : In article <2t1tgb$oab@msuinfo.cl.msu.edu> mcfallry@cps.msu.edu > (Ryan L Mcfall) writes: > : > We were just wondering if anyone can explain what Informix does > with > : > a cursor that makes it more efficient than a select statement? > Does > : > it circumvent optimizing the statement multiple times? > : > > : As I understood it, a cursor is the device used to align the > different > : impedances between some application program and the relational > model. > : A query may return a whole bunch of rows, whereas a sequential > program > : must get them one by one. > : H. > Carrying it one step further, even if a select could show you more > than one row, it wouldn't allow you to scroll or do > relative/absolute fetches of rows based on some outside stimuli. -- Going another step further, if you didn't have cursors you would always have to bring all the rows that met your criteria into your program (assuming you could do that), when you may only be interested in the first one or a couple, thereby giving you a performance hit because of the engine reading far more data than you wanted. akent@cix.compulink.co.uk (Andy Kent) ------------------------------------- 44 272 742815