-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
refactor: reduce OpenAPI(PKcols in table, ViewKeyDependency type) #2254
Conversation
e17e3f4
to
701c152
Compare
I tested this PR on the big schema and compared it with a commit previous to the recent refactors(bc7d54c).
It shows that the PR makes the metadata(OpenAPI should follow as well) generation faster. The size of the output was also reduced:
|
Btw, just noted the big schema(apflora) is OSS: https://github.com/FNSKtZH/apflora_api/tree/master/sql. I think we can now include it in our tests. |
701c152
to
c645e0a
Compare
OpenAPI on the big schema also goes down from ~45s(#2256 (comment)) to ~18s:
|
* Get PKcols inside tables - done with SQL for tables and with an additional step in Haskell for views. This fixes an fk column being considered as a pk column on views and corrects the test added on https://github.com/PostgREST/postgrest/pull/1875/files/1d549768580310e18aac4ffa6dbd01c5b77934a7#r853674126 * classify view key dependencies in SQL * remove Column from Relationship * Merge cols/fcols in Relationship and ensure allM2ORels and allViewsKeyDependencies fk columns are ordered - done by attnum in SQL * Cardinality now contains relColumns instead of Relationship - this simplifies getJoinConditions.
c645e0a
to
d5b92a4
Compare
Get PKcols inside tables - done with SQL for tables and with an additional step in Haskell for views.
This fixes an fk column being considered as a pk column on views and corrects the test added on https://github.com/PostgREST/postgrest/pull/1875/files/1d549768580310e18aac4ffa6dbd01c5b77934a7#r853674126
classify view key dependencies in SQL
remove Column from Relationship
Merge cols/fcols in Relationship and ensure allM2ORels and allViewsKeyDependencies fk columns are ordered - done by attnum in SQL
Cardinality now contains relColumns instead of Relationship - this simplifies getJoinConditions.