maria-developers team mailing list archive
Mailing list archive
Re: INFORMATION_SCHEMA.SCHEMATA and INFORMATION_SCHEMA.SCHEMA_PRIVILEGES
On Mar 05, Witold Filipczyk wrote:
> > > The idea to resolve it is:
> > > in find_files(...) instead of the for loop execute query:
> > > SELECT REPLACE(TABLE_SCHEMA, '\\', '') FROM INFORMATION_SCHEMA.SCHEMA_PRIVILEGES WHERE PRIVILEGE_TYPE = 'SELECT';
> > > There are databases with names with _ in them and \_ in GRANTS.
> > That's a very interesting idea.
> > Basically, you're saying that if a user has no probal privileges and
> > database privileges on only one database and no wildcards in the
> > database name (*), then SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
> > essentially has an implicit WHERE schema_name="FOO" clause. Yes,
> > that's certainly doable. It's even not very difficult to do, I'd
> > think.
> I guess, I did not understand.
> I did something like this:
> And turned on INFORMATION_SCHEMA in phpmyadmin and it is slow, very
> slow. What I'm doing wrong here? How to speed up?
I cannot answer it like that, sorry.
The idea looks good and promising.
Your implementation looks fine too, I didn't spot anything obviously
wrong. Try to profile your code, see where it spends the time.
Chief Architect MariaDB