diesel-rs/diesel
在 GitHub 查看Experiment with generate `allow_columns_to_appear_in_same_group_by_clause!` via `diesel print-schema`
Open
#2,555 建立於 2020年11月5日
clidiscussion desiredgood first issuehelp wantedmentoring available
描述
#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:
- Similar to
allow_tables_in_same_query!here we want to generate a call toallow_columns_to_appear_in_same_group_by_clause!. All required data are contained inself.tables. We need to iterate over all tables and all columns for each table and generate the corresponding macro call there. - 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.rswith the change in 1. applied - Generate a
schema.rswithout 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.rsmodule (but to some other module) may be interesting.
- Comment those numbers here, discuss if they are a acceptable hit