[Phpmyadmin-devel] about explicit LIMIT

Marc Delisle Marc.Delisle at cegepsherbrooke.qc.ca
Sun Dec 16 13:56:30 CET 2007


cand. inf. Alexander M. Turek a écrit :
> Hi there,
> 
> Marc Delisle schrieb:
>> Now if a user typed a LIMIT clause, what should he expect?
>>
>> (1) To be able to move thru the entire table
>> (2) or just thru the result set he chose in his LIMIT clause?
>>
>> Reading this bug report
>> https://sourceforge.net/tracker/index.php?func=detail&aid=1846013&group_id=23067&atid=377408
>>
>> the user expects (1). I am not sure but I tend to say (2) because of the 
>> explicit LIMIT.
> 
> I'd vote for (2), at least for consistency. The result does not have to
> be just the contents of a table, it may be a complex join or an
> aggregation as well. Maybe I'm only interested in the topmost 100
> results and this is why I explicitly added that LIMIT.
> 
> This does not affected browsing only, but also reordering. Let's say, I
> want to see the top 10 payments made:
> 
> SELECT * FROM `payment` ORDER BY `amount` DESC LIMIT 10
> 
> Now, I get the result and I want to have these ten records ordered by
> the date of the payment. I would expect that this is what I get when
> clicking the "payment_date" column, but phpMyAdmin then throws away my
> LIMIT and my ORDER BY and I get:
> 
> SELECT * FROM `payment` ORDER BY `payment`.`payment_date` ASC LIMIT 0,30
> 
> Even if my LIMIT would be kept, I would most propably get different records.

Right. I opened bug #1851833 for this, to avoid mixing different bugs in 
the same bug ID.

> 
> Regards,
> 
> Alexander




More information about the Developers mailing list