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

Generate Select * for queries when applicable for shorter SQL #21320

Open
Tracked by #18923
smitpatel opened this issue Jun 18, 2020 · 2 comments
Open
Tracked by #18923

Generate Select * for queries when applicable for shorter SQL #21320

smitpatel opened this issue Jun 18, 2020 · 2 comments

Comments

@smitpatel
Copy link
Contributor

Currently we project all the columns from a table in the projection. We can project SELECT t.* for generate shorter SQL.
Notes to implementer:

  • Best place to do would be SQL Gen. Method GenerateProjection. We can detect that all the projection expressions are column expression and coming from same table then we can use table.* directly.
  • Overriding method will allow provider to change the "optimization". e.g. postgres does not project "xmin" column out of the table, SELECT * in such cases, need to list all the columns.
@AndriySvyryd
Copy link
Member

We do this defensively akin the discriminators. This behavior should be toggleable.

@roji
Copy link
Member

roji commented Jun 20, 2020

Overriding method will allow provider to change the "optimization". e.g. postgres does not project "xmin" column out of the table, SELECT * in such cases, need to list all the columns.

Thanks for remembering PG :) PG can actually also do SELECT xmin, t.* so this is useful even when we need xmin.

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

No branches or pull requests

4 participants