[Phpmyadmin-devel] about explicit LIMIT

Marc Delisle Marc.Delisle at cegepsherbrooke.qc.ca
Sun Dec 16 14:12:22 CET 2007


Sebastian Mendel a écrit :
> cand. inf. Alexander M. Turek schrieb:
>> Hi again,
>>
>> Sebastian Mendel schrieb:
>>> seeing what he queried, if he wrote LIMIT 0,2 we should show two lines
>>> per page
>>>
>> What should phpMyAdmin do, if he queries "LIMIT 0,1000000"? Or "LIMIT
>> 1000000"? Displaying a page that might crash his browser might not be
>> his intention. ;-)
> 
> it is the users decission ... what will you do if he writes 10.000 in the 
> results per page input box?

Indeed we never blocked this. Also, even if we don't activate the 
ShowAll feature by default, if it's activated crashes may occur but we 
warn users in the doc :)
> 
> phpMyAdmin is a tool! ... user should know how to use! ... if he writes 
> LIMIT 10000 phpMyAdmin should do - there is no need to force the user into 
> any limitations ...

I agree. Also in the future there might be super browsers on super 
machines that can handle what current browsers cannot.
> 
> 
>> And what shall we do in the following case?
>>
>> SELECT * FROM (SELECT * FROM table LIMIT 0,2) t;
> 
> nothing, add the defualt LIMIT 0,30
> 
> 
>> This would be semantically identical to
>>
>> SELECT * FROM table LIMIT 0,2;
> 
> no, it is not - from th point of phpMyAdmin, for phpMyAdmin only the 
> resulting rows are relevant, and if they don't limited by the user, PMA will do
> 
> 
>> Should we handle it differently? If not, do you really want to walk
>> through each query and collect all limits? :-/
> 
> no, subselcts are not relevant, interesting are only the resulting rows
> 
> 
>> If I wanted to browse the unlimited result, I would omit the LIMIT.
> 
> yes, and PMA will paginate it
> 
> 
> i do not see a problem if someone writes LIMIT 0,10 and PMA shows 10 rows on 
> the first page, and pagfination for all the the other rows

> possible we should replace the curent behaviour for PMA 3.0:
> 
>   - do not add any LIMIT
>   - just surround the user supplied query with SELECT * FROM ([user query]) 
> LIMIT ...
>   - this will also work with sorting a query that is limited to 10 first 
> rows sorted
> 
I'm not sure it's a good idea to force subqueries for all queries. Also 
it would not fix the problem for the 2.11 branch which will be alive a 
number of years.




More information about the Developers mailing list