Re: find position of row in set of rows

From: Tim X <timx_at_nospam.dev.null>
Date: Sun, 31 Jan 2010 11:22:43 +1100
Message-ID: <874om3cecs.fsf_at_lion.rapttech.com.au>



Mark D Powell <Mark.Powell2_at_hp.com> writes:

> On Jan 28, 11:46 pm, Galen Boyer <galen_bo..._at_yahoo.com> wrote:
>> Mladen Gogala <gogala.mla..._at_gmail.com> writes:
>> > If you need a database to return you an ordered list, you are having
>> > an application design issue.
>>
>> I thought you just added an "order the naive set" clause.  :-)
>>
>> --
>> Galen Boyer
>>
>> --- news://freenews.netfront.net/ - complaints: n..._at_netfront.net ---
>
>
> "If you need a database to return you an ordered list, you are having
> an application design issue."
>
> I think that this statement is a little overly broad. After all the
> order by clause exists for a reason. It is often desired to return an
> ordered set of data to make the data more useful. After all it is
> much easier to find the desired account, name, or other valid value
> off an ordered drop down list than using a list in random order!
>
> Mgogala, has a point in that how you order a list can be both of
> questionable value and the ordering itself can be questionable based
> on how the dasta is stored and retrieved. Nevertheless, I will
> respectively disagree that ordering a set is wrong or in any way
> invalid in itself. It is how you order it and what you try to do with
> it that may be invalid.
>

Agreed and well said. It is sometimes also useful to consider the alternative - this usually means retrieving an unordered result set into the application level and sorting it there. My feeling is that we can get better performance doing this at the database level than we can at the application level, even if it does represent a polution of the relational model.

Tim

-- 
tcross (at) rapttech dot com dot au
Received on Sat Jan 30 2010 - 18:22:43 CST

Original text of this message