Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to exclude system/non-user tables #5764

Open
mvorisek opened this issue Oct 16, 2022 · 4 comments
Open

Allow to exclude system/non-user tables #5764

mvorisek opened this issue Oct 16, 2022 · 4 comments

Comments

@mvorisek
Copy link
Contributor

mvorisek commented Oct 16, 2022

Feature Request

this is a result of investigation of #5698

Q A
New Feature yes
RFC no

Summary

in atk4/data we are excluding Oracle system tables by extending the OraclePlatform::getListTablesSQL method

https://github.com/atk4/data/blob/0c6bce5c2ac53589934b02bc0832a4753c283f15/src/Persistence/Sql/Oracle/PlatformTrait.php#L111-L119

we do so to massively improve the discovery performance as listing the system/non-user table is not helpful

in DBAL 3.3 this reduced the tests time from hours to about 2 minutes

in DBAL 3.4.x #5268 was introuced, which reduced the time, without the custom OraclePlatform::getListTablesSQL method override described above, to about 8 minutes

this is a feature request to filter the oracle_maintained tables (and objects in general) out by default and/or to provide an option in schema manager to enable/disable such filtering

@mvorisek
Copy link
Contributor Author

mvorisek commented Oct 16, 2022

if no official customization of schema manager is wanted, I would be happy with a protected method in OracleSchemaManager::getListTablesSQL() (or in OraclePlatform::getListTablesSQL() as before) which will be inserted as a subquery in all queries where all tables are used

@morozov
Copy link
Member

morozov commented Oct 17, 2022

Filtering out oracle_maintained tables by default sounds reasonable. But how does schema management work now if they don't get filtered out?

In general, the DBAL introspects the schema for the purpose of managing it, so the tables that it cannot manage should be ignored.

@mvorisek
Copy link
Contributor Author

in atk4/data we use the system user which has global permissions granted

https://github.com/atk4/data/blob/c30e90879bbf21ec946d648ee112d32b90edc9fd/.github/workflows/test-unit.yml#L238-L242

and then the tables are visible

looking into DBAL CI https://github.com/doctrine/dbal/blob/3.4.x/.github/workflows/continuous-integration.yml it seems this is also what DBAL CI does

But how does schema management work now if they don't get filtered out?

so it seems DBAL CI either creates some non-system user somewhere before running the tests or actually lists all tables (incl. the oracle_maintained) - is there any tests asserting there are no tables in CI database?


please also remove the block for my user, currently, I do not receive any notifications, no notificantions about your commnets, closes, ... which leads to #5698 (comment) :(

@morozov
Copy link
Member

morozov commented Oct 19, 2022

is there any tests asserting there are no tables in CI database?

Most likely, no. Such a test would fail if run as part of the test suite because most of the tests clean up before themselves but not after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants