Subject Re: [IBDI] function TOP n FROM... was (Porting from...)
Author Helen Borrie
At 06:10 PM 25-06-00 +0200, you wrote:

>But what about performance?
>How fast is a subquery compared with an iterative
>loop in a stored procedure?
>This was the idea behind my asking for TOP function
>if it´s implemented in servers standard functions it could be faster?

TOP isn't standard SQL and it's not a very sensible kind of thing to ask of
a Client/Server database, given that the data isn't stored in any physical
order. I'd be surprised if got anywhere near the top of anyone's list of
"must-haves" for InterBase.

As to your question, I find anything using subqueries to be a very slow way
to fill a column in a dataset. But, in the case where you are fetching a
tiny dataset, it could be cheaper. Why not try it out and let us know the
difference? Don't forget - I'm trawling for wisdom like this for the
Gotchas section of the IBDH.

Helen
http://www.interbase2000.org
___________________________________________________
"Ask not what your free, open-source database can do for you,
but what you can do for your free, open-source database."
(J.F.K.)