The Wayback Machine - https://web.archive.org/web/20201125104541/https://github.com/diesel-rs/diesel/issues/2555
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

Experiment with generate `allow_columns_to_appear_in_same_group_by_clause!` via `diesel print-schema` #2555

Open
weiznich opened this issue Nov 5, 2020 · 0 comments

Comments

@weiznich
Copy link
Member

@weiznich weiznich commented Nov 5, 2020

#2549 introduced the allow_columns_to_appear_in_same_group_by_clause! macro that allows you to use more than one column in your group by clause. It opted not to generate a call to this macro for all columns in the schema via diesel print-schema due to compile time concerns.
I would like to see some experimentation and some concert numbers for the actual compile time impact of this. As I think that's a good first issue, I will writeup some steps for someone willing to work on this:

  1. Similar to allow_tables_in_same_query! here we want to generate a call to allow_columns_to_appear_in_same_group_by_clause!.
    All required data are contained in self.tables. We need to iterate over all tables and all columns for each table and generate the corresponding macro call there.
  2. Test the impact on compile time of the generated schema.
    • That means get/generate a database with a large number of tables and columns (probably something that has >1000 columns or so).
    • Generate a schema.rs with the change in 1. applied
    • Generate a schema.rs without the change in 1. applied
    • Check and writedown the from scratch debug and release compile time for both variants. Also the incremental compile time without any change to the schema.rs module (but to some other module) may be interesting.
  3. Comment those numbers here, discuss if they are a acceptable hit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.