[Phpmyadmin-devel] about explicit LIMIT

Sebastian Mendel lists at sebastianmendel.de
Sun Dec 16 11:13:59 CET 2007


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?

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 ...


> 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

-- 
Sebastian




More information about the Developers mailing list