[Phpmyadmin-devel] SHOW DATABASES on ISPs
Marc Delisle
Marc.Delisle at cegepsherbrooke.qc.ca
Tue Jan 22 23:16:11 CET 2008
Sebastian Mendel a écrit :
> Hi,
>
> SHOW DATABASES seems somehow slow on ISPs
>
> how about using I_S.SCHEMA_PRIVILEGES
>
> f.e.
>
> SELECT *
> FROM `SCHEMA_PRIVILEGES`
> LIMIT 0 , 30
>
> performs much faster on the ISP i could test:
>
> 0.08 sec vs. 0.24 seconds
>
>
> possible this will only work with ISPs where are no anonymous rights
>
> possible a configuration where ISP can use I_S.SCHEMA_PRIVILEGES instead of
> SHOW DATABASES, or they can switch to SHOW DATABASES like '[user]_%' which
> performs much faster too
>
> how about
>
> $cfg['DatabaseListQuery'] = 'SHOW DATABASES';
> // #user# is replaced by curent user
> $cfg['DatabaseListQuery'] = "SHOW DATABASES LIKE '#user#%'";
> $cfg['DatabaseListQuery'] = 'SELECT DISTINCT TABLE_SCHEMA FROM
> `SCHEMA_PRIVILEGES`';
>
>
Maybe I don't understand your idea SHOW DATABASES LIKE 'user%'; naming
databases with user names is only a convention, this is why SHOW
DATABASES is better IMO in general. Promoting this in PMA could confuse
a sysadmin into thinking that this is used to get the databases on which
this user has access.
For your last idea, I think you meant SELECT DISTINCT TABLE_SCHEMA FROM
INFORMATION_SCHEMA.SCHEMA_PRIVILEGES.
I'll make some tests on servers with a various number of databases.
Of course, picking the best default value for $cfg['DatabaseListQuery']
depends on the results of our tests.
Marc
More information about the Developers
mailing list