berlindb / core

All of the required core code
MIT License
256 stars 29 forks source link

Maybe optimize lookups of tables in DB to stop using SHOW TABLES LIKE #165

Closed Khadreal closed 2 months ago

Khadreal commented 2 months ago

One of our customers reported a performance issue related to berlindb especially for sites with large tables. This is related to SHOW TABLES... query in. https://github.com/berlindb/core/blob/9c4d1fe588b4bff7b9f45091d7890bbbef9c0bc4/src/Database/Table.php#L351

The proposed solution Changed the query to below, we could see improved performance when we do this. we've forked the repo but before creating a PR we thought opening a ticket here to know if there are other things we aren't considering with the solution.

SELECT table_name FROM information_schema.tables WHERE table_name = '%s' LIMIT 1

alexstandiford commented 2 months ago

I'm actually going to be working with BerlinDB for a project sometime soon. While I've got it cloned I'll take a look at the PR, too.

Thanks for sharing!