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

Speedup compile times for joins #3288

Merged
merged 6 commits into from
Aug 25, 2022

Commits on Aug 19, 2022

  1. Prototype skipping the SelectableExpression check for the

    `DefaultSelection` type of joins
    
    This commit introduces infrastructure that allows to skip type checking
    the `DefaultSelection` of joins. diesel-rs#3223 discovered that this is
    responsible for a substantial amount of compile time for larger
    joins/codebases. We do not need to check this constraint there as it is
    always true because each of the tables/sides of the join already have an
    valid `DefaultSelection`. Therefore the resulting `DefaultSelection`
    must be valid for the join too (if there is no bug in diesel itself).
    weiznich committed Aug 19, 2022
    Configuration menu
    Copy the full SHA
    567bb1d View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2022

  1. Make it compile in more cases + impl for left join

    it doesn't compile as-is.
    The reason for this is that with this implem,
    ```rust
    	let q = schema::some_table_1::table
    		.inner_join(schema::some_table_2::table)
    		.inner_join(schema::some_table_3::table.inner_join(schema::some_table_4::table));
    ```
    won't compile, because of this bound:
    ```
    impl<Left, Right> QuerySource for Join<Left, Right, Inner>
    where
        Left: AppendSelection<Right::DefaultSelection>,
    ```
    and we don't have `Left = Join<LeftLeft, LeftRight, Inner>: AppendSelection<SkipSelectableExpressionWrapper<_>>`
    because we don't have `SkipSelectableExpressionWrapper<_>:
    TupleAppend<SkipSelectableExpressionWrapper<_>>`
    Ten0 committed Aug 22, 2022
    Configuration menu
    Copy the full SHA
    d88e389 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2022

  1. Configuration menu
    Copy the full SHA
    d5fc92b View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2022

  1. Update diesel/src/query_source/joins.rs

    Co-authored-by: Ten0 <9094255+Ten0@users.noreply.github.com>
    weiznich and Ten0 authored Aug 25, 2022
    Configuration menu
    Copy the full SHA
    7829e0d View commit details
    Browse the repository at this point in the history
  2. Rename SkipSelectableExpressionWrapper to `SkipSelectableExpression…

    …BoundCheckWrapper` as suggested in review
    weiznich committed Aug 25, 2022
    Configuration menu
    Copy the full SHA
    3a8acc3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d3dc7e5 View commit details
    Browse the repository at this point in the history