<div dir="ltr"><div>Hi,</div><div><br></div><div>I would like to talk about this ticket: <a href="https://sourceforge.net/p/phpmyadmin/bugs/4070/">https://sourceforge.net/p/phpmyadmin/bugs/4070/</a></div><div>The issue is that when you want to limit the number of items (last level) by page in navigation tree, you can have an issue with the last group.</div>

<div><br></div><div>Imagine that you set the config to 25 items, you have a first group of 20 DB, and another one of 15 DB. Here, the last group will contain only 5 items and not all the group. But there is no information that there is other children of this group, so you can believe that you see all the items of the group.</div>

<div><br></div><div>I think that we better have to filter on the first level, than on the number of the last level items…</div><div><br></div><div>The list of DB could be get by one query:</div><div><div>select s.*</div>
<div>
from INFORMATION_SCHEMA.SCHEMATA s,</div><div>(</div><div>select DB_first_level</div><div>from (</div><div>SELECT SCHEMA_NAME, SUBSTRING_INDEX(SCHEMA_NAME, '_', 1) DB_first_level</div><div>FROM INFORMATION_SCHEMA.SCHEMATA</div>

<div>) t</div><div>ORDER BY DB_first_level ASC</div><div>LIMIT 1, 3</div><div>) t2</div><div>where 1 = locate(concat(DB_first_level, '_'), concat(s.SCHEMA_NAME, '_'))</div><div>order by s.SCHEMA_NAME;</div>

</div><div><br></div><div>(Here, I assume that the first level separator is "_" and that we want 3 items of first level.)</div><div><br></div><div>(If someone has basics of optimisation and have some idea to improve this query, it could be useful.)</div>

<div><br></div><div>What do you think about removing limit number of last level items and replace it by a limit of first level items?</div><div>Or any idea to fix the issue in another way?</div><div><br></div><div>Thanks,</div>

<div>Hugues.</div></div>