Re: Is relational theory irrelevant?

From: Christopher Browne <cbbrowne_at_acm.org>
Date: 14 Nov 2003 21:52:41 GMT
Message-ID: <bp3ir9$1k22pm$3_at_ID-125932.news.uni-berlin.de>


In an attempt to throw the authorities off his trail, "Bob Badour" <bbadour_at_golden.net> transmitted:
> Certainly, any actual process involves the conceptual and the
> physical. What advantage to the logical model does the rank offer
> that is not offered by other logical constructs that already exist?

I'm not sure, either. I would have thought that taking the various "LIMIT" and "OFFSET" "TOP" keywords and standardizing it would be more sensible.

The rank functions look to me as though they have the potential to get _really_ expensive to evaluate, and not because they are buying some massive advantage.

Fabian Pascal presents, as a "standard" way of doing it,   SELECT a.ename, a.sale_amt
   FROM sales a, sales b
   WHERE a.sale_amt <= b.sale_amt
   GROUP BY a.ename, a.sale_amt
   HAVING COUNT(*) <= q
   ORDER BY a.sale_amt

This query is _clever_; it is anything but straightforward, and I'd expect horrendous performance.

I'd much rather have something like

SELECT FIRST 5 [values] FROM [tables] ORDER BY [order];

I don't much care if it's:

  • SELECT FIRST 5
  • SELECT TOP 5 VALUES -- Which might return 8 items
    • if there were lots of ties
  • SELECT [stuff] LIMIT 10;

There's a theoretic question of the difference between "first 5 rows" versus "first 5 'values'", where the latter might return 25 rows if there were a whole bunch of ties for first and third place. I'm content to be ambivalent about how that should be handled, because that seems to me to be context-dependent.

If I'm scoring a race, I may want the top 5 values, however many particpants that may pick. In other cases, I may simply want the first 5 rows, whatever they may be about.

-- 
(format nil "~S_at_~S" "aa454" "freenet.carleton.ca")
http://www.ntlug.org/~cbbrowne/wp.html
It is  in the tranquillity of  decomposition that I  remember the long
confused emotion which was my life.
Received on Fri Nov 14 2003 - 22:52:41 CET

Original text of this message