[Phpmyadmin-devel] about explicit LIMIT
cand. inf. Alexander M. Turek
me at derrabus.de
Sat Dec 15 17:57:24 CET 2007
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.
Regards,
Alexander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20071215/fdb603bc/attachment.sig>
More information about the Developers
mailing list