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

Only select required columns from sql databases #15169

Draft
wants to merge 46 commits into
base: chore/guard-display-column-in-the-api
Choose a base branch
from

Conversation

adrinr
Copy link
Collaborator

@adrinr adrinr commented Dec 12, 2024

Description

Edit the SQL generation (for both external and sqs) in order to not include select *. Instead, pull only the required fields. This applies both on the requested table rows plus the linked relationships. This change will increase performance, not pulling non-needed data.

There is an exception for this when there is a formula field on the requested fields. Given that this formula might use other columns, we need to pull it all in order to compute them.

Launchcontrol

Smarter SQL select, requesting only the required data.

Copy link

linear bot commented Dec 12, 2024

Copy link

qa-wolf bot commented Dec 12, 2024

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

@github-actions github-actions bot added firestorm Data/Infra/Revenue Team size/s labels Dec 12, 2024
@adrinr adrinr force-pushed the BUDI-8885/only-select-required-columns-from-sql-databases branch from 4fb5f8c to da92c3b Compare December 12, 2024 15:59
@adrinr adrinr changed the title Budi 8885/only select required columns from sql databases Only select required columns from sql databases Dec 13, 2024
@github-actions github-actions bot added size/m and removed size/s labels Dec 16, 2024
@adrinr adrinr force-pushed the BUDI-8885/only-select-required-columns-from-sql-databases branch from 2bfcb11 to 7f3b73f Compare December 17, 2024 10:31
@adrinr adrinr force-pushed the BUDI-8885/only-select-required-columns-from-sql-databases branch from 93ca4cc to 23531e1 Compare December 17, 2024 15:12
@adrinr adrinr changed the base branch from master to chore/guard-display-column-in-the-api December 18, 2024 12:46
…nly-select-required-columns-from-sql-databases
@@ -292,11 +281,9 @@ class InternalBuilder {

const alias = this.getTableName(table)
const schema = this.table.schema
if (!this.isFullSelectStatementRequired()) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The logic for it has been moved to sqlUtils

@github-actions github-actions bot added size/l and removed size/m labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
firestorm Data/Infra/Revenue Team size/l
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant