Use postgres-specific tables to read database schema
Fixes performance issues noted in #199.
On my production server, the original query took 22 seconds to retrieve 272 rows. This new query takes 204ms and retrieves the same rows.
This is based off @alextech query in #199 and adapted to be a drop-in replacement (it returns the correct values for check_option and is_updatable.
Closes #199
@mat128 thank for the PR, it looks very good! We need to provide a test for this change. We have a test/integration folder where we can test PostgreSQL using Travis CI, see this database test configuration.
Have a look and let me know if you need assistance adding this integration test, thanks!
This repository has been moved to laminas/laminas-db. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:
- Squash all commits in your branch (
git rebase -i origin/{branch}) - Make a note of all changed files (`git diff --name-only origin/{branch}...HEAD
- Run the laminas/laminas-migration tool on the code.
- Clone laminas/laminas-db to another directory.
- Copy the files from the second bullet point to the clone of laminas/laminas-db.
- In your clone of laminas/laminas-db, commit the files, push to your fork, and open the new PR. We will be providing tooling via laminas/laminas-migration soon to help automate the process.
This repository has been closed and moved to laminas/laminas-db; a new issue has been opened at https://github.com/laminas/laminas-db/issues/48.