Jan Hlavat� wrote:

> 
> Schroeder, Alexander wrote:
> > Hello Jan,
> > 
> > the rowno predicate works BEFORE applying an ORDER BY predicate. See
> > 
> >  
> http://www.sapdb.org/7.4/htmhelp/8c/ccce30c71c11d2a97100a0c944
9261/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 ;)


You want to have the first n rows according to your ordering.
Ok, then do not use ROWNO or anything of that kind, but just fetch the first n rows 
afterwards.
If all rows have to be in an ordering before the limitation to the first n rows can 
take place,
the kernel has to prepare the whole resultset (or is a lucky guy which can use an index
which will avoid the physical ordering of all resultrows). But noone says that you 
have to
fetch all resultrows if you just want the first n resultrows.

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

Reply via email to