Schroeder, Alexander wrote:
Hello Jan,

the rowno predicate works BEFORE applying an ORDER BY predicate. See

 http://www.sapdb.org/7.4/htmhelp/8c/ccce30c71c11d2a97100a0c9449261/content.htm

for further details. This is not a bug.
Well, it is not a bug in terms of discrepancy between documentation and functionality.

It is a bug (in my eyes) as to its functionality.

I would expect that reason for something like ROWNO would be a situation like i described - i.e. limiting results of query to first n rows.
What use would limiting record count have, if it is unclear as to which rows will be there???

Limiting results in my sense (after ORDER BY) would have practical use.
Typical example is a web application displaying pages of catalog items, which have to be in some sensible order (like product name or part number). You can have millions of entries in the catalog. You don't want to execute a query to return all records in calatlog and then pick just some records and throw away the rest - that would kill performance for any but minimal number of records. (Well, I have seen many bad designs like this deployed in reality. These sites die from success. That's not acceptable to me.)

My way of using ROWNO would enable querying ranges of records corresponing to single page from catalog, with peak efficiency.

And, by omitting ORDER BY clause, you get the old behaviour.

With ROWNO as it is currently implemented, only use I see is to get a random sample of records (are you using it for generating statistics??)


CONSIDER THIS AN OFFICIAL ENHANCEMENT REQUEST ;)

Jan

_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to