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

fix(typegen): omit columns when querying tables #585

Merged
merged 5 commits into from
Jun 7, 2023

Conversation

soedirgo
Copy link
Member

@soedirgo soedirgo commented Jun 6, 2023

Or views etc. This can be expensive on a complex enough schema and can easily trip over the 15s timeout.

Instead, query all columns separately, which should hopefully be less taxing and easier to plan.

Also omit excluded schemas when listing tables/views/etc.

Benchmark results on 100 tables with 100 columns each:

Before:

  Time (mean ± σ):      8.134 s ±  0.211 s    [User: 0.094 s, System: 0.017 s]
  Range (min … max):    7.857 s …  8.569 s    10 runs

After:

  Time (mean ± σ):      1.787 s ±  0.113 s    [User: 0.094 s, System: 0.016 s]
  Range (min … max):    1.648 s …  1.980 s    10 runs

Or views etc. This can be expensive on a complex enough schema and can
easily trip over the 15s timeout.

Instead, query all columns separately, which should hopefully be less
taxing and easier to plan.

Also omit excluded schemas when listing tables/views/etc.
@soedirgo soedirgo requested review from a team as code owners June 6, 2023 10:58
Copy link
Contributor

@kevcodez kevcodez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming you tested this thoroughly, can't judge the functionality, but the code LGTM! And the performance improvements...

@soedirgo soedirgo merged commit d707f4f into master Jun 7, 2023
4 checks passed
@soedirgo soedirgo deleted the fix/typegen-omit-columns-from-tables-query branch June 7, 2023 01:38
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

Successfully merging this pull request may close these issues.

None yet

2 participants