Re: Any Way to Limit Number of Rows Returned?
Posted in 1996
billy@west.co.za (Billy Wheeler) wrote: :> Any of you Informix gurus know if there is any way to limit the number :> of rows that a query can return in Informix 7.x and up. What I would :> like to do is to be able to prevent the 'killer query' from running :> and returning a trillion rows and consuming all of the resources. I :> know you have the LXHWM and LXEHWM plus the PDQ parameters if you have :> PDQ turned on, but is there any other way to stop a killer query from :> running before it starts or at least limit the number of rows returned :> such as setting some type of global parameter? :> :> Anixously waiting for some answers....thanks in advance for any info. :Erm. Well, if you're in 4GL or whatever, you can exit your loop :programmatically, or else in OnLine 8.x (XPS) you can say something like :SELECT FIRST 20 * :FROM tablea :WHERE.... :*I* think it would be nice if this feature could be put into all versions of :the engine, but I don't know if Informix ever will... :-/ Agreed, very nice. At the user conference they said that most of the special features of XPS would be moved to standard DSA (Universal Server probably) as well. They didn't explicitly talk about this feature though. In addition to the number of rows returned there should also be a way to set the maximum number of rows read so we could easily make a select terminate long before it had started returning rows (while it was selecting and sorting) so "runaway" selects could easily be controlled. Nils.Myklebust@ccmail.telemax.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company