[Phpmyadmin-devel] #4070 Confusing database/table grouping
Hugues Peccatte
hugues.peccatte at gmail.com
Tue Apr 15 21:18:12 CEST 2014
Hi,
I would like to talk about this ticket:
https://sourceforge.net/p/phpmyadmin/bugs/4070/
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.
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.
I think that we better have to filter on the first level, than on the
number of the last level items…
The list of DB could be get by one query:
select s.*
from INFORMATION_SCHEMA.SCHEMATA s,
(
select DB_first_level
from (
SELECT SCHEMA_NAME, SUBSTRING_INDEX(SCHEMA_NAME, '_', 1) DB_first_level
FROM INFORMATION_SCHEMA.SCHEMATA
) t
ORDER BY DB_first_level ASC
LIMIT 1, 3
) t2
where 1 = locate(concat(DB_first_level, '_'), concat(s.SCHEMA_NAME, '_'))
order by s.SCHEMA_NAME;
(Here, I assume that the first level separator is "_" and that we want 3
items of first level.)
(If someone has basics of optimisation and have some idea to improve this
query, it could be useful.)
What do you think about removing limit number of last level items and
replace it by a limit of first level items?
Or any idea to fix the issue in another way?
Thanks,
Hugues.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20140415/48356147/attachment.html>
More information about the Developers
mailing list