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

Query: Translate querys with filter on sub-query to a single SQL statement #7122

Closed
myblindy opened this issue Nov 24, 2016 · 7 comments
Closed
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@myblindy
Copy link

Code that fails

    public static IQueryable<DrDr> FilterBySearchParameters(this IQueryable<DrDr> collection, SearchState searchstate)
    {
        if (searchstate.ProjectIDs?.Any() == true)
            collection = collection.Where(dr => searchstate.ProjectIDs.Contains(dr.Project));
        if (searchstate.StatusIDs?.Any() == true)
            // test case, this is the problem line. Original line has Contains like above, but even this fails
            collection = collection.Where(dr => dr.DrHistory.First().Status == 3);  

        return collection;
    }

         var res = await collection
                .Include(w => w.DrHistory)
                    .ThenInclude(w => w.StatusNavigation)
                .Include(w => w.DrHistory)
                    .ThenInclude(w => w.AssignedNavigation)
                .Include(w => w.ProjectNavigation)
                .Include(w => w.AtaNavigation)
                .FilterBySearchParameters(searchstate)
                .OrderBy(w => w.ProjectNavigation.Nn).ThenBy(w => w.ProjDr)
                .Skip(pager.PageSize * (pager.CurrentPage - 1)).Take(pager.PageSize)
                .ToListAsync()

Expectation & Result

I'd expect it to run in a single query, but what happens is hundreds of little queries to dr_status and one large query that filters on dr_proj as expected. In fact if I remove the DrStatus part of the filter, it all works exactly as expected with no problems.

Trace

Compiling query model: 
'(from DrDr dr in 
    (from DrDr w in DbSet<DrDr>
    select w)
    .Include([w].DrHistory.StatusNavigation)
    .Include([w].DrHistory.AssignedNavigation)
    .Include([w].ProjectNavigation)
    .Include([w].AtaNavigation)
where 
    (from int <generated>_1 in __searchstate_ProjectIDs_0
    select <generated>_1)
    .Contains([dr].Project)
where 
    (from DrHistory <generated>_1 in dr.DrHistory
    select <generated>_1)
    .First().Status == 3
order by dr.ProjectNavigation.Nn ascdr.ProjDr asc, 
select dr)
.Skip(__p_1)
.Take(__p_2)'
Optimized query model: 
'(from DrDr w in DbSet<DrDr>
join DrProj w.ProjectNavigation in DbSet<DrProj>
on Property(w, "Project") equals Property(w.ProjectNavigation, "Id")
where 
    (from int <generated>_1 in __searchstate_ProjectIDs_0
    select <generated>_1)
    .Contains([w].Project)
where 
    (from DrHistory <generated>_1 in DbSet<DrHistory>
    where Property(w, "Id") == Property(<generated>_1, "DrNum")
    select <generated>_1.Status)
    .First() == 3
order by w.ProjectNavigation.Nn ascw.ProjDr asc, 
select w)
.Skip(__p_1)
.Take(__p_2)'
The LINQ expression 'First()' could not be translated and will be evaluated locally. To configure this warning use the DbContextOptionsBuilder.ConfigureWarnings API (event id 'RelationalEventId.QueryClientEvaluationWarning'). ConfigureWarnings can be used when overriding the DbContext.OnConfiguring method or using AddDbContext on the application service provider.
The LINQ expression '({from DrHistory <generated>_1 in value(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[mdrdb.Models.DrHistory]) where (Property([w], "Id") == Property([<generated>_1], "DrNum")) select [<generated>_1].Status => First()} == 3)' could not be translated and will be evaluated locally. To configure this warning use the DbContextOptionsBuilder.ConfigureWarnings API (event id 'RelationalEventId.QueryClientEvaluationWarning'). ConfigureWarnings can be used when overriding the DbContext.OnConfiguring method or using AddDbContext on the application service provider.
The LINQ expression 'First()' could not be translated and will be evaluated locally. To configure this warning use the DbContextOptionsBuilder.ConfigureWarnings API (event id 'RelationalEventId.QueryClientEvaluationWarning'). ConfigureWarnings can be used when overriding the DbContext.OnConfiguring method or using AddDbContext on the application service provider.
The LINQ expression 'Skip(__p_1)' could not be translated and will be evaluated locally. To configure this warning use the DbContextOptionsBuilder.ConfigureWarnings API (event id 'RelationalEventId.QueryClientEvaluationWarning'). ConfigureWarnings can be used when overriding the DbContext.OnConfiguring method or using AddDbContext on the application service provider.
The LINQ expression 'Take(__p_2)' could not be translated and will be evaluated locally. To configure this warning use the DbContextOptionsBuilder.ConfigureWarnings API (event id 'RelationalEventId.QueryClientEvaluationWarning'). ConfigureWarnings can be used when overriding the DbContext.OnConfiguring method or using AddDbContext on the application service provider.
Including navigation: 'w.DrHistory.StatusNavigation'
Including navigation: 'w.DrHistory.AssignedNavigation'
Including navigation: 'w.ProjectNavigation'
Including navigation: 'w.AtaNavigation'
TRACKED: True
(QueryContext queryContext) => IAsyncEnumerable<DrDr> Take(
    source: IAsyncEnumerable<DrDr> Skip(
        source: IAsyncEnumerable<DrDr> _Select(
            source: IAsyncEnumerable<TransparentIdentifier<DrDr, ValueBuffer>> _Where(
                source: IAsyncEnumerable<TransparentIdentifier<DrDr, ValueBuffer>> _Include(
                    queryContext: (RelationalQueryContext) queryContext, 
                    innerResults: IAsyncEnumerable<TransparentIdentifier<DrDr, ValueBuffer>> _Include(
                        queryContext: (RelationalQueryContext) queryContext, 
                        innerResults: IAsyncEnumerable<TransparentIdentifier<DrDr, ValueBuffer>> _Include(
                            queryContext: (RelationalQueryContext) queryContext, 
                            innerResults: IAsyncEnumerable<TransparentIdentifier<DrDr, ValueBuffer>> _Include(
                                queryContext: (RelationalQueryContext) queryContext, 
                                innerResults: IAsyncEnumerable<TransparentIdentifier<DrDr, ValueBuffer>> _ShapedQuery(
                                    queryContext: queryContext, 
                                    shaperCommandContext: SelectExpression: 
                                        SELECT [w].[id], [w].[assigned], [w].[ata], [w].[custsupportref], [w].[date_required], [w].[dateofrepro], [w].[descr1], [w].[descr2], [w].[discrepancyid], [w].[documenttypeid], [w].[documentversion], [w].[due_date], [w].[flightcond], [w].[load], [w].[mano], [w].[priority], [w].[proj_dr], [w].[project], [w].[referencedata], [w].[relationshipid], [w].[relationshipto], [w].[reprodescr], [w].[reprodoneby], [w].[reproducible], [w].[reprotechnicalanalysis], [w].[reprotrainingdevice], [w].[softwarelog], [w].[softwarelogoriginalname], [w].[softwaretitle], [w].[tags], [w].[test_guide], [d5].[id], [d5].[ac_name], [d5].[customer], [d5].[last_change], [d5].[name], [d5].[nn], [d6].[id], [d6].[descr]
                                        FROM [dr_dr] AS [w]
                                        INNER JOIN [dr_proj] AS [w.ProjectNavigation] ON [w].[project] = [w.ProjectNavigation].[id]
                                        INNER JOIN [dr_proj] AS [d5] ON [w].[project] = [d5].[id]
                                        INNER JOIN [dr_ata] AS [d6] ON [w].[ata] = [d6].[id]
                                        WHERE 0 = 1
                                        ORDER BY [w.ProjectNavigation].[nn], [w].[proj_dr], [w].[id]
                                    , 
                                    shaper: CompositeShaper`3
                                )
                                , 
                                entityAccessor: (TransparentIdentifier<DrDr, ValueBuffer> t0) => t0.Outer, 
                                navigationPath: INavigation[] { DrDr.AtaNavigation, }, 
                                relatedEntitiesLoaderFactories: new Func<QueryContext, IAsyncRelatedEntitiesLoader>[]{ (QueryContext ) => IAsyncRelatedEntitiesLoader _CreateReferenceRelatedEntitiesLoader(
                                        valueBufferOffset: 37, 
                                        queryIndex: 0, 
                                        materializer: (ValueBuffer valueBuffer) => 
                                        {
                                            var3 = new DrAta()
                                            var3.<Id>k__BackingField = try { (short) object valueBuffer.get_Item(0) } catch (Exception) { ... } 
                                            var3.<Descr>k__BackingField = try { (string) object valueBuffer.get_Item(1) } catch (Exception) { ... } 
                                            return instance
                                        }
                                    )
                                     }
                                , 
                                querySourceRequiresTracking: True
                            )
                            , 
                            entityAccessor: (TransparentIdentifier<DrDr, ValueBuffer> t0) => t0.Outer, 
                            navigationPath: INavigation[] { DrDr.ProjectNavigation, }, 
                            relatedEntitiesLoaderFactories: new Func<QueryContext, IAsyncRelatedEntitiesLoader>[]{ (QueryContext ) => IAsyncRelatedEntitiesLoader _CreateReferenceRelatedEntitiesLoader(
                                    valueBufferOffset: 31, 
                                    queryIndex: 0, 
                                    materializer: (ValueBuffer valueBuffer) => 
                                    {
                                        var4 = new DrProj()
                                        var4.<Id>k__BackingField = try { (int) object valueBuffer.get_Item(0) } catch (Exception) { ... } 
                                        var4.<AcName>k__BackingField = try { (string) object valueBuffer.get_Item(1) } catch (Exception) { ... } 
                                        var4.<Customer>k__BackingField = try { (string) object valueBuffer.get_Item(2) } catch (Exception) { ... } 
                                        var4.<LastChange>k__BackingField = try { (string) object valueBuffer.get_Item(3) } catch (Exception) { ... } 
                                        var4.<Name>k__BackingField = try { (string) object valueBuffer.get_Item(4) } catch (Exception) { ... } 
                                        var4.<Nn>k__BackingField = try { (string) object valueBuffer.get_Item(5) } catch (Exception) { ... } 
                                        return instance
                                    }
                                )
                                 }
                            , 
                            querySourceRequiresTracking: True
                        )
                        , 
                        entityAccessor: (TransparentIdentifier<DrDr, ValueBuffer> t0) => t0.Outer, 
                        navigationPath: INavigation[] { DrDr.DrHistory, DrHistory.AssignedNavigation, }, 
                        relatedEntitiesLoaderFactories: new Func<QueryContext, IAsyncRelatedEntitiesLoader>[]
                        { 
                            (QueryContext ) => IAsyncRelatedEntitiesLoader _CreateCollectionRelatedEntitiesLoader(
                                queryContext: , 
                                shaperCommandContext: SelectExpression: 
                                    SELECT [d3].[dr_num], [d3].[hist_num], [d3].[addedfilesgroup], [d3].[assigned], [d3].[attachmentID], [d3].[author], [d3].[date], [d3].[deletedfilesgroup], [d3].[descr], [d3].[enteredby], [d3].[fixedfilesgroup], [d3].[internal], [d3].[log_user_id], [d3].[status], [d3].[version], [d4].[id], [d4].[addhistory], [d4].[addnewdr], [d4].[fname], [d4].[initials], [d4].[isactive], [d4].[lname], [d4].[mname], [d4].[username], [d4].[viewewodr], [d4].[viewewohwtengdr], [d4].[viewinternaldr]
                                    FROM [dr_history] AS [d3]
                                    INNER JOIN (
                                        SELECT DISTINCT [w.ProjectNavigation].[nn], [w].[proj_dr], [w].[id]
                                        FROM [dr_dr] AS [w]
                                        INNER JOIN [dr_proj] AS [w.ProjectNavigation] ON [w].[project] = [w.ProjectNavigation].[id]
                                        WHERE 0 = 1
                                    ) AS [w1] ON [d3].[dr_num] = [w1].[id]
                                    INNER JOIN [dr_employee] AS [d4] ON [d3].[assigned] = [d4].[id]
                                    ORDER BY [w1].[nn], [w1].[proj_dr], [w1].[id]
                                , 
                                queryIndex: 1, 
                                materializer: (ValueBuffer valueBuffer) => 
                                {
                                    var5 = new DrHistory()
                                    var5.<DrNum>k__BackingField = try { (int) object valueBuffer.get_Item(0) } catch (Exception) { ... } 
                                    var5.<HistNum>k__BackingField = try { (int) object valueBuffer.get_Item(1) } catch (Exception) { ... } 
                                    var5.<Addedfilesgroup>k__BackingField = try { (Nullable<int>) object valueBuffer.get_Item(2) } catch (Exception) { ... } 
                                    var5.<Assigned>k__BackingField = try { (Nullable<short>) object valueBuffer.get_Item(3) } catch (Exception) { ... } 
                                    var5.<AttachmentId>k__BackingField = try { (Nullable<int>) object valueBuffer.get_Item(4) } catch (Exception) { ... } 
                                    var5.<Author>k__BackingField = try { (string) object valueBuffer.get_Item(5) } catch (Exception) { ... } 
                                    var5.<Date>k__BackingField = try { (string) object valueBuffer.get_Item(6) } catch (Exception) { ... } 
                                    var5.<Deletedfilesgroup>k__BackingField = try { (Nullable<int>) object valueBuffer.get_Item(7) } catch (Exception) { ... } 
                                    var5.<Descr>k__BackingField = try { (string) object valueBuffer.get_Item(8) } catch (Exception) { ... } 
                                    var5.<Enteredby>k__BackingField = try { (string) object valueBuffer.get_Item(9) } catch (Exception) { ... } 
                                    var5.<Fixedfilesgroup>k__BackingField = try { (Nullable<int>) object valueBuffer.get_Item(10) } catch (Exception) { ... } 
                                    var5.<Internal>k__BackingField = try { (bool) object valueBuffer.get_Item(11) } catch (Exception) { ... } 
                                    var5.<LogUserId>k__BackingField = try { (Nullable<int>) object valueBuffer.get_Item(12) } catch (Exception) { ... } 
                                    var5.<Status>k__BackingField = try { (int) object valueBuffer.get_Item(13) } catch (Exception) { ... } 
                                    var5.<Version>k__BackingField = try { (string) object valueBuffer.get_Item(14) } catch (Exception) { ... } 
                                    return instance
                                }
                            )
                            , 
                            (QueryContext ) => IAsyncRelatedEntitiesLoader _CreateReferenceRelatedEntitiesLoader(
                                valueBufferOffset: 15, 
                                queryIndex: 1, 
                                materializer: (ValueBuffer valueBuffer) => 
                                {
                                    var6 = new DrEmployee()
                                    var6.<Id>k__BackingField = try { (short) object valueBuffer.get_Item(0) } catch (Exception) { ... } 
                                    var6.<Addhistory>k__BackingField = try { (Nullable<bool>) object valueBuffer.get_Item(1) } catch (Exception) { ... } 
                                    var6.<Addnewdr>k__BackingField = try { (Nullable<bool>) object valueBuffer.get_Item(2) } catch (Exception) { ... } 
                                    var6.<Fname>k__BackingField = try { (string) object valueBuffer.get_Item(3) } catch (Exception) { ... } 
                                    var6.<Initials>k__BackingField = try { (string) object valueBuffer.get_Item(4) } catch (Exception) { ... } 
                                    var6.<Isactive>k__BackingField = try { (Nullable<bool>) object valueBuffer.get_Item(5) } catch (Exception) { ... } 
                                    var6.<Lname>k__BackingField = try { (string) object valueBuffer.get_Item(6) } catch (Exception) { ... } 
                                    var6.<Mname>k__BackingField = try { (string) object valueBuffer.get_Item(7) } catch (Exception) { ... } 
                                    var6.<Username>k__BackingField = try { (string) object valueBuffer.get_Item(8) } catch (Exception) { ... } 
                                    var6.<Viewewodr>k__BackingField = try { (Nullable<bool>) object valueBuffer.get_Item(9) } catch (Exception) { ... } 
                                    var6.<Viewewohwtengdr>k__BackingField = try { (Nullable<bool>) object valueBuffer.get_Item(10) } catch (Exception) { ... } 
                                    var6.<Viewinternaldr>k__BackingField = try { (Nullable<bool>) object valueBuffer.get_Item(11) } catch (Exception) { ... } 
                                    return instance
                                }
                            )
                             
                        }
                        , 
                        querySourceRequiresTracking: True
                    )
                    , 
                    entityAccessor: (TransparentIdentifier<DrDr, ValueBuffer> t0) => t0.Outer, 
                    navigationPath: INavigation[] { DrDr.DrHistory, DrHistory.StatusNavigation, }, 
                    relatedEntitiesLoaderFactories: new Func<QueryContext, IAsyncRelatedEntitiesLoader>[]
                    { 
                        (QueryContext ) => IAsyncRelatedEntitiesLoader _CreateCollectionRelatedEntitiesLoader(
                            queryContext: , 
                            shaperCommandContext: SelectExpression: 
                                SELECT [d1].[dr_num], [d1].[hist_num], [d1].[addedfilesgroup], [d1].[assigned], [d1].[attachmentID], [d1].[author], [d1].[date], [d1].[deletedfilesgroup], [d1].[descr], [d1].[enteredby], [d1].[fixedfilesgroup], [d1].[internal], [d1].[log_user_id], [d1].[status], [d1].[version], [d2].[id], [d2].[descr], [d2].[sortid], [d2].[status]
                                FROM [dr_history] AS [d1]
                                INNER JOIN (
                                    SELECT DISTINCT [w.ProjectNavigation].[nn], [w].[proj_dr], [w].[id]
                                    FROM [dr_dr] AS [w]
                                    INNER JOIN [dr_proj] AS [w.ProjectNavigation] ON [w].[project] = [w.ProjectNavigation].[id]
                                    WHERE 0 = 1
                                ) AS [w0] ON [d1].[dr_num] = [w0].[id]
                                INNER JOIN [dr_status] AS [d2] ON [d1].[status] = [d2].[id]
                                ORDER BY [w0].[nn], [w0].[proj_dr], [w0].[id]
                            , 
                            queryIndex: 2, 
                            materializer: (ValueBuffer valueBuffer) => 
                            {
                                var7 = new DrHistory()
                                var7.<DrNum>k__BackingField = try { (int) object valueBuffer.get_Item(0) } catch (Exception) { ... } 
                                var7.<HistNum>k__BackingField = try { (int) object valueBuffer.get_Item(1) } catch (Exception) { ... } 
                                var7.<Addedfilesgroup>k__BackingField = try { (Nullable<int>) object valueBuffer.get_Item(2) } catch (Exception) { ... } 
                                var7.<Assigned>k__BackingField = try { (Nullable<short>) object valueBuffer.get_Item(3) } catch (Exception) { ... } 
                                var7.<AttachmentId>k__BackingField = try { (Nullable<int>) object valueBuffer.get_Item(4) } catch (Exception) { ... } 
                                var7.<Author>k__BackingField = try { (string) object valueBuffer.get_Item(5) } catch (Exception) { ... } 
                                var7.<Date>k__BackingField = try { (string) object valueBuffer.get_Item(6) } catch (Exception) { ... } 
                                var7.<Deletedfilesgroup>k__BackingField = try { (Nullable<int>) object valueBuffer.get_Item(7) } catch (Exception) { ... } 
                                var7.<Descr>k__BackingField = try { (string) object valueBuffer.get_Item(8) } catch (Exception) { ... } 
                                var7.<Enteredby>k__BackingField = try { (string) object valueBuffer.get_Item(9) } catch (Exception) { ... } 
                                var7.<Fixedfilesgroup>k__BackingField = try { (Nullable<int>) object valueBuffer.get_Item(10) } catch (Exception) { ... } 
                                var7.<Internal>k__BackingField = try { (bool) object valueBuffer.get_Item(11) } catch (Exception) { ... } 
                                var7.<LogUserId>k__BackingField = try { (Nullable<int>) object valueBuffer.get_Item(12) } catch (Exception) { ... } 
                                var7.<Status>k__BackingField = try { (int) object valueBuffer.get_Item(13) } catch (Exception) { ... } 
                                var7.<Version>k__BackingField = try { (string) object valueBuffer.get_Item(14) } catch (Exception) { ... } 
                                return instance
                            }
                        )
                        , 
                        (QueryContext ) => IAsyncRelatedEntitiesLoader _CreateReferenceRelatedEntitiesLoader(
                            valueBufferOffset: 15, 
                            queryIndex: 2, 
                            materializer: (ValueBuffer valueBuffer) => 
                            {
                                var8 = new DrStatus()
                                var8.<Id>k__BackingField = try { (int) object valueBuffer.get_Item(0) } catch (Exception) { ... } 
                                var8.<Descr>k__BackingField = try { (string) object valueBuffer.get_Item(1) } catch (Exception) { ... } 
                                var8.<Sortid>k__BackingField = try { (Nullable<int>) object valueBuffer.get_Item(2) } catch (Exception) { ... } 
                                var8.<Status>k__BackingField = try { (string) object valueBuffer.get_Item(3) } catch (Exception) { ... } 
                                return instance
                            }
                        )
                         
                    }
                    , 
                    querySourceRequiresTracking: True
                )
                , 
                predicate: (TransparentIdentifier<DrDr, ValueBuffer> t0) => int Result(
                    task: Task<int> _First(
                        source: IAsyncEnumerable<int> _Select(
                            source: IAsyncEnumerable<ValueBuffer> _InjectParameters(
                                queryContext: queryContext, 
                                source: IAsyncEnumerable<ValueBuffer> _ShapedQuery(
                                    queryContext: queryContext, 
                                    shaperCommandContext: SelectExpression: 
                                        SELECT TOP(1) [d0].[status]
                                        FROM [dr_history] AS [d0]
                                        WHERE @_outer_Id = [d0].[dr_num]
                                    , 
                                    shaper: ValueBufferShaper
                                )
                                , 
                                parameterNames: new string[]{ "_outer_Id" }
                                , 
                                parameterValues: new object[]{ (object) Nullable<int> GetValue(
                                        queryContext: queryContext, 
                                        entity: t0.Outer, 
                                        property: Id
                                    )
                                     }
                            )
                            , 
                            selector: (ValueBuffer <generated>_1) => try { (int) object <generated>_1.get_Item(0) } catch (Exception) { ... } 
                        )
                        , 
                        cancellationToken: queryContext.CancellationToken
                    )
                )
                 == 3
            )
            , 
            selector: (TransparentIdentifier<DrDr, ValueBuffer> t0) => t0.Outer
        )
        , 
        count: int GetParameterValue(
            queryContext: queryContext, 
            parameterName: "__p_1"
        )
    )
    , 
    count: int GetParameterValue(
        queryContext: queryContext, 
        parameterName: "__p_2"
    )
)

Further technical details

EF Core version: 1.1.0
Operating system: Win7 x64 SP1
Visual Studio version: VS2015 U3

Other details about my project setup: This is a vanilla ASP.NET Core 1.0.1 project, if that matters. I will add the full model classes in a comment below, they're pretty large.

@myblindy
Copy link
Author

The model context

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.Entity<DrAta>(entity =>
        {
            entity.ToTable("dr_ata");

            entity.Property(e => e.Id).HasColumnName("id");

            entity.Property(e => e.Descr)
                .IsRequired()
                .HasColumnName("descr")
                .HasColumnType("char(100)");
        });

        modelBuilder.Entity<DrDr>(entity =>
        {
            entity.ToTable("dr_dr");

            entity.HasIndex(e => new { e.Id, e.ProjDr, e.Project, e.DueDate })
                .HasName("ix_dr_dr3");

            entity.HasIndex(e => new { e.Id, e.DateRequired, e.TestGuide, e.Assigned, e.Referencedata, e.Documentversion, e.Relationshipid, e.Relationshipto, e.Documenttypeid, e.Reproducible, e.Flightcond, e.Mano, e.Load, e.Descr1, e.Descr2, e.DueDate, e.Custsupportref, e.Softwaretitle, e.Dateofrepro, e.Reprodoneby, e.Reprodescr, e.Reprotrainingdevice, e.Reprotechnicalanalysis, e.Softwarelog, e.Softwarelogoriginalname, e.Project, e.Ata, e.ProjDr, e.Priority, e.Discrepancyid })
                .HasName("ix_dr_dr_priority_project");

            entity.HasIndex(e => new { e.Id, e.DateRequired, e.TestGuide, e.Ata, e.Assigned, e.Referencedata, e.Documentversion, e.Relationshipid, e.Relationshipto, e.Documenttypeid, e.Reproducible, e.Flightcond, e.Mano, e.Load, e.Descr1, e.Descr2, e.DueDate, e.Custsupportref, e.Softwaretitle, e.Dateofrepro, e.Reprodoneby, e.Reprodescr, e.Reprotrainingdevice, e.Reprotechnicalanalysis, e.Softwarelog, e.Softwarelogoriginalname, e.ProjDr, e.Discrepancyid, e.Project, e.Priority })
                .HasName("ix_dr_dr");

            entity.HasIndex(e => new { e.Id, e.DateRequired, e.TestGuide, e.Ata, e.Assigned, e.Referencedata, e.Documentversion, e.Relationshipid, e.Relationshipto, e.Documenttypeid, e.Reproducible, e.Flightcond, e.Mano, e.Load, e.Descr1, e.Descr2, e.DueDate, e.Custsupportref, e.Softwaretitle, e.Dateofrepro, e.Reprodoneby, e.Reprodescr, e.Reprotrainingdevice, e.Reprotechnicalanalysis, e.Softwarelog, e.Softwarelogoriginalname, e.Project, e.ProjDr, e.Priority, e.Discrepancyid })
                .HasName("ix_dr_dr2");

            entity.Property(e => e.Id)
                .HasColumnName("id")
                .ValueGeneratedNever();

            entity.Property(e => e.Assigned).HasColumnName("assigned");

            entity.Property(e => e.Ata)
                .HasColumnName("ata")
                .HasDefaultValueSql("1");

            entity.Property(e => e.Custsupportref)
                .HasColumnName("custsupportref")
                .HasColumnType("nchar(30)");

            entity.Property(e => e.DateRequired)
                .HasColumnName("date_required")
                .HasColumnType("char(12)");

            entity.Property(e => e.Dateofrepro)
                .HasColumnName("dateofrepro")
                .HasColumnType("nchar(12)");

            entity.Property(e => e.Descr1)
                .HasColumnName("descr1")
                .HasColumnType("varchar(max)");

            entity.Property(e => e.Descr2)
                .HasColumnName("descr2")
                .HasColumnType("varchar(max)");

            entity.Property(e => e.Discrepancyid)
                .HasColumnName("discrepancyid")
                .HasDefaultValueSql("2");

            entity.Property(e => e.Documenttypeid).HasColumnName("documenttypeid");

            entity.Property(e => e.Documentversion)
                .HasColumnName("documentversion")
                .HasColumnType("nchar(10)");

            entity.Property(e => e.DueDate)
                .HasColumnName("due_date")
                .HasColumnType("nchar(12)");

            entity.Property(e => e.Flightcond)
                .HasColumnName("flightcond")
                .HasColumnType("nchar(40)");

            entity.Property(e => e.Load)
                .HasColumnName("load")
                .HasColumnType("nchar(25)");

            entity.Property(e => e.Mano)
                .HasColumnName("mano")
                .HasColumnType("nchar(40)");

            entity.Property(e => e.Priority)
                .IsRequired()
                .HasColumnName("priority")
                .HasColumnType("char(20)")
                .HasDefaultValueSql("0");

            entity.Property(e => e.ProjDr).HasColumnName("proj_dr");

            entity.Property(e => e.Project).HasColumnName("project");

            entity.Property(e => e.Referencedata)
                .HasColumnName("referencedata")
                .HasColumnType("nchar(200)");

            entity.Property(e => e.Relationshipid).HasColumnName("relationshipid");

            entity.Property(e => e.Relationshipto).HasColumnName("relationshipto");

            entity.Property(e => e.Reprodescr)
                .HasColumnName("reprodescr")
                .HasColumnType("varchar(max)");

            entity.Property(e => e.Reprodoneby)
                .HasColumnName("reprodoneby")
                .HasColumnType("nchar(30)");

            entity.Property(e => e.Reproducible).HasColumnName("reproducible");

            entity.Property(e => e.Reprotechnicalanalysis)
                .HasColumnName("reprotechnicalanalysis")
                .HasColumnType("varchar(max)");

            entity.Property(e => e.Reprotrainingdevice)
                .HasColumnName("reprotrainingdevice")
                .HasColumnType("nchar(40)");

            entity.Property(e => e.Softwarelog)
                .HasColumnName("softwarelog")
                .HasColumnType("nchar(50)");

            entity.Property(e => e.Softwarelogoriginalname)
                .HasColumnName("softwarelogoriginalname")
                .HasColumnType("nchar(100)");

            entity.Property(e => e.Softwaretitle)
                .HasColumnName("softwaretitle")
                .HasColumnType("nchar(50)");

            entity.Property(e => e.Tags)
                .HasColumnName("tags")
                .HasColumnType("varchar(max)");

            entity.Property(e => e.TestGuide)
                .HasColumnName("test_guide")
                .HasColumnType("char(50)");

            entity.HasOne(d => d.AtaNavigation)
                .WithMany(p => p.DrDr)
                .HasForeignKey(d => d.Ata)
                .HasConstraintName("FK_dr_dr_dr_ata");

            entity.HasOne(d => d.ProjectNavigation)
                .WithMany(p => p.DrDr)
                .HasForeignKey(d => d.Project)
                .OnDelete(DeleteBehavior.Restrict)
                .HasConstraintName("FK_dr_dr_dr_proj");
        });

        modelBuilder.Entity<DrEmployee>(entity =>
        {
            entity.ToTable("dr_employee");

            entity.HasIndex(e => new { e.Id, e.Mname, e.Initials, e.Addhistory, e.Addnewdr, e.Viewinternaldr, e.Isactive, e.Viewewohwtengdr, e.Viewewodr, e.Username, e.Lname, e.Fname })
                .HasName("ix_dr_employee_username")
                .IsUnique();

            entity.Property(e => e.Id)
                .HasColumnName("id")
                .ValueGeneratedOnAdd();

            entity.Property(e => e.Addhistory)
                .IsRequired()
                .HasColumnName("addhistory")
                .HasDefaultValueSql("0");

            entity.Property(e => e.Addnewdr)
                .IsRequired()
                .HasColumnName("addnewdr")
                .HasDefaultValueSql("0");

            entity.Property(e => e.Fname)
                .IsRequired()
                .HasColumnName("fname")
                .HasColumnType("char(50)");

            entity.Property(e => e.Initials)
                .IsRequired()
                .HasColumnName("initials")
                .HasColumnType("char(5)");

            entity.Property(e => e.Isactive)
                .IsRequired()
                .HasColumnName("isactive")
                .HasDefaultValueSql("1");

            entity.Property(e => e.Lname)
                .IsRequired()
                .HasColumnName("lname")
                .HasColumnType("char(50)");

            entity.Property(e => e.Mname)
                .IsRequired()
                .HasColumnName("mname")
                .HasColumnType("char(20)");

            entity.Property(e => e.Username)
                .IsRequired()
                .HasColumnName("username")
                .HasColumnType("char(20)");

            entity.Property(e => e.Viewewodr)
                .IsRequired()
                .HasColumnName("viewewodr")
                .HasDefaultValueSql("0");

            entity.Property(e => e.Viewewohwtengdr)
                .IsRequired()
                .HasColumnName("viewewohwtengdr")
                .HasDefaultValueSql("0");

            entity.Property(e => e.Viewinternaldr)
                .IsRequired()
                .HasColumnName("viewinternaldr")
                .HasDefaultValueSql("0");

            entity.HasOne(d => d.IdNavigation)
                .WithOne(p => p.InverseIdNavigation)
                .HasForeignKey<DrEmployee>(d => d.Id)
                .OnDelete(DeleteBehavior.Restrict)
                .HasConstraintName("FK_dr_employee_dr_employee");
        });

        modelBuilder.Entity<DrHistory>(entity =>
        {
            entity.HasKey(e => new { e.DrNum, e.HistNum })
                .HasName("PK_dr_history_1");

            entity.ToTable("dr_history");

            entity.HasIndex(e => new { e.DrNum, e.HistNum, e.Status })
                .HasName("pk_dr_history")
                .IsUnique();

            entity.HasIndex(e => new { e.HistNum, e.DrNum, e.AttachmentId })
                .HasName("ix_dr_history_attachments");

            entity.HasIndex(e => new { e.Date, e.Version, e.Author, e.Descr, e.Assigned, e.Enteredby, e.Fixedfilesgroup, e.Addedfilesgroup, e.Deletedfilesgroup, e.AttachmentId, e.Internal, e.LogUserId, e.Status, e.DrNum, e.HistNum })
                .HasName("ix_dr_history_drnum_histnum")
                .IsUnique();

            entity.Property(e => e.DrNum).HasColumnName("dr_num");

            entity.Property(e => e.HistNum).HasColumnName("hist_num");

            entity.Property(e => e.Addedfilesgroup)
                .IsRequired()
                .HasColumnName("addedfilesgroup");

            entity.Property(e => e.Assigned)
                .IsRequired()
                .HasColumnName("assigned");

            entity.Property(e => e.AttachmentId)
                .IsRequired()
                .HasColumnName("attachmentID");

            entity.Property(e => e.Author)
                .IsRequired()
                .HasColumnName("author")
                .HasColumnType("char(30)");

            entity.Property(e => e.Date)
                .IsRequired()
                .HasColumnName("date")
                .HasColumnType("char(10)");

            entity.Property(e => e.Deletedfilesgroup)
                .IsRequired()
                .HasColumnName("deletedfilesgroup");

            entity.Property(e => e.Descr)
                .IsRequired()
                .HasColumnName("descr")
                .HasColumnType("varchar(max)");

            entity.Property(e => e.Enteredby)
                .IsRequired()
                .HasColumnName("enteredby")
                .HasColumnType("char(30)");

            entity.Property(e => e.Fixedfilesgroup)
                .IsRequired()
                .HasColumnName("fixedfilesgroup");

            entity.Property(e => e.Internal).HasColumnName("internal");

            entity.Property(e => e.LogUserId)
                .IsRequired()
                .HasColumnName("log_user_id");

            entity.Property(e => e.Status).HasColumnName("status");

            entity.Property(e => e.Version)
                .IsRequired()
                .HasColumnName("version")
                .HasColumnType("char(50)");

            entity.HasOne(d => d.AssignedNavigation)
                .WithMany(p => p.DrHistory)
                .HasForeignKey(d => d.Assigned)
                .OnDelete(DeleteBehavior.Restrict)
                .HasConstraintName("FK_dr_history_dr_employee");

            entity.HasOne(d => d.DrNumNavigation)
                .WithMany(p => p.DrHistory)
                .HasForeignKey(d => d.DrNum)
                .HasConstraintName("FK_dr_history_dr_dr");

            entity.HasOne(d => d.StatusNavigation)
                .WithMany(p => p.DrHistory)
                .HasForeignKey(d => d.Status)
                .OnDelete(DeleteBehavior.Restrict)
                .HasConstraintName("FK_dr_history_dr_status");

            entity.HasOne(d => d.DrHistoryNavigation)
                .WithOne(p => p.InverseDrHistoryNavigation)
                .HasForeignKey<DrHistory>(d => new { d.DrNum, d.HistNum })
                .OnDelete(DeleteBehavior.Restrict)
                .HasConstraintName("FK_dr_history_dr_history");
        });

        modelBuilder.Entity<DrProj>(entity =>
        {
            entity.ToTable("dr_proj");

            entity.HasIndex(e => new { e.Id, e.Name, e.AcName, e.Customer, e.Nn })
                .HasName("ix_dr_proj_nn");

            entity.Property(e => e.Id).HasColumnName("id");

            entity.Property(e => e.AcName)
                .HasColumnName("ac_name")
                .HasColumnType("char(50)");

            entity.Property(e => e.Customer)
                .IsRequired()
                .HasColumnName("customer")
                .HasColumnType("char(20)");

            entity.Property(e => e.LastChange)
                .HasColumnName("last_change")
                .HasColumnType("char(10)");

            entity.Property(e => e.Name)
                .IsRequired()
                .HasColumnName("name")
                .HasColumnType("char(50)");

            entity.Property(e => e.Nn)
                .HasColumnName("nn")
                .HasColumnType("varchar(10)");
        });

        modelBuilder.Entity<DrStatus>(entity =>
        {
            entity.ToTable("dr_status");

            entity.Property(e => e.Id).HasColumnName("id");

            entity.Property(e => e.Descr)
                .HasColumnName("descr")
                .HasColumnType("char(100)");

            entity.Property(e => e.Sortid).HasColumnName("sortid");

            entity.Property(e => e.Status)
                .IsRequired()
                .HasColumnName("status")
                .HasColumnType("char(20)");
        });
    }

@myblindy
Copy link
Author

DrDr

public partial class DrDr
{
    public DrDr()
    {
        DrHistory = new HashSet<DrHistory>();
    }

    public int Id { get; set; }
    public int ProjDr { get; set; }
    public string DateRequired { get; set; }
    public string Priority { get; set; }
    public string TestGuide { get; set; }
    public int Project { get; set; }
    public short Ata { get; set; }
    public short? Assigned { get; set; }
    public int? Discrepancyid { get; set; }
    public string Referencedata { get; set; }
    public string Documentversion { get; set; }
    public int? Relationshipid { get; set; }
    public int? Relationshipto { get; set; }
    public int? Documenttypeid { get; set; }
    public bool? Reproducible { get; set; }
    public string Flightcond { get; set; }
    public string Mano { get; set; }
    public string Load { get; set; }
    public string Descr1 { get; set; }
    public string Descr2 { get; set; }
    public string DueDate { get; set; }
    public string Custsupportref { get; set; }
    public string Softwaretitle { get; set; }
    public string Dateofrepro { get; set; }
    public string Reprodoneby { get; set; }
    public string Reprodescr { get; set; }
    public string Reprotrainingdevice { get; set; }
    public string Reprotechnicalanalysis { get; set; }
    public string Softwarelog { get; set; }
    public string Softwarelogoriginalname { get; set; }
    public string Tags { get; set; }

    public virtual ICollection<DrHistory> DrHistory { get; set; }
    public virtual DrAta AtaNavigation { get; set; }
    public virtual DrProj ProjectNavigation { get; set; }
}

DrHistory

public partial class DrHistory
{
    public int DrNum { get; set; }
    public int HistNum { get; set; }
    public string Date { get; set; }
    public string Version { get; set; }
    public string Author { get; set; }
    public string Descr { get; set; }
    public bool Internal { get; set; }
    public int? LogUserId { get; set; }
    public int Status { get; set; }
    public short? Assigned { get; set; }
    public string Enteredby { get; set; }
    public int? Fixedfilesgroup { get; set; }
    public int? Addedfilesgroup { get; set; }
    public int? Deletedfilesgroup { get; set; }
    public int? AttachmentId { get; set; }

    public virtual DrEmployee AssignedNavigation { get; set; }
    public virtual DrDr DrNumNavigation { get; set; }
    public virtual DrStatus StatusNavigation { get; set; }
    public virtual DrHistory DrHistoryNavigation { get; set; }
    public virtual DrHistory InverseDrHistoryNavigation { get; set; }
}

DrStatus

public partial class DrStatus
{
    public DrStatus()
    {
        DrHistory = new HashSet<DrHistory>();
    }

    public int Id { get; set; }
    public string Status { get; set; }
    public string Descr { get; set; }
    public int? Sortid { get; set; }

    public virtual ICollection<DrHistory> DrHistory { get; set; }
}

The others shouldn't be important, but let me know if they're needed nonetheless.

@maumar
Copy link
Contributor

maumar commented Nov 25, 2016

Try using FirstOrDefault instead of First. We never translate First because we are unable to properly simulate its behavior for empty collection (i.e. Throwing exception)

@myblindy
Copy link
Author

Interesting thought, so I tried FirstOrDefault for my status fiter, same as my project filter:

    public static IQueryable<DrDr> FilterBySearchParameters(this IQueryable<DrDr> collection, SearchState searchstate)
    {
        if (searchstate.ProjectIDs?.Any() == true)
            collection = collection.Where(dr => searchstate.ProjectIDs.Contains(dr.Project));
        if (searchstate.StatusIDs?.Any() == true)
            collection = collection.Where(dr => searchstate.StatusIDs.Contains(dr.DrHistory.FirstOrDefault().Status));

        return collection;
    }

Unfortunately it's doing the same thing, albeit without the warnings. It's filtering in the query for the project ID (using in()), then doing individual queries for the status:

SELECT [d0].[dr_num], [d0].[hist_num], [d0].[addedfilesgroup], [d0].[assigned], [d0].[attachmentID], [d0].[author], [d0].[date], [d0].[deletedfilesgroup], [d0].[descr], [d0].[enteredby], [d0].[fixedfilesgroup], [d0].[internal], [d0].[log_user_id], [d0].[status], [d0].[version], [d1].[id], [d1].[descr], [d1].[sortid], [d1].[status]
FROM [dr_history] AS [d0]
INNER JOIN (
    SELECT DISTINCT [w.ProjectNavigation].[nn], [w].[proj_dr], [w].[id]
    FROM [dr_dr] AS [w]
    INNER JOIN [dr_proj] AS [w.ProjectNavigation] ON [w].[project] = [w.ProjectNavigation].[id]
    WHERE [w].[project] IN (539)
) AS [w0] ON [d0].[dr_num] = [w0].[id]
INNER JOIN [dr_status] AS [d1] ON [d0].[status] = [d1].[id]
ORDER BY [w0].[nn], [w0].[proj_dr], [w0].[id]
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT [d].[dr_num], [d].[status]
FROM [dr_history] AS [d]
Closing connection to database 'drdb' on server '(localdb)\drdb'.
Opening connection to database 'drdb' on server '(localdb)\drdb'.
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT [d].[dr_num], [d].[status]
FROM [dr_history] AS [d]
Closing connection to database 'drdb' on server '(localdb)\drdb'.
Opening connection to database 'drdb' on server '(localdb)\drdb'.
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT [d].[dr_num], [d].[status]
FROM [dr_history] AS [d]
Closing connection to database 'drdb' on server '(localdb)\drdb'.
Opening connection to database 'drdb' on server '(localdb)\drdb'.
Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT [d].[dr_num], [d].[status]
FROM [dr_history] AS [d]
Closing connection to database 'drdb' on server '(localdb)\drdb'.
Opening connection to database 'drdb' on server '(localdb)\drdb'.
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT [d].[dr_num], [d].[status]
FROM [dr_history] AS [d]
Closing connection to database 'drdb' on server '(localdb)\drdb'.
Opening connection to database 'drdb' on server '(localdb)\drdb'.
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT [d].[dr_num], [d].[status]
FROM [dr_history] AS [d]
Closing connection to database 'drdb' on server '(localdb)\drdb'.
Opening connection to database 'drdb' on server '(localdb)\drdb'.
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT [d].[dr_num], [d].[status]
FROM [dr_history] AS [d]
Closing connection to database 'drdb' on server '(localdb)\drdb'.
Opening connection to database 'drdb' on server '(localdb)\drdb'.
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT [d].[dr_num], [d].[status]
FROM [dr_history] AS [d]
Closing connection to database 'drdb' on server '(localdb)\drdb'.
Opening connection to database 'drdb' on server '(localdb)\drdb'.
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT [d].[dr_num], [d].[status]
FROM [dr_history] AS [d]
Closing connection to database 'drdb' on server '(localdb)\drdb'.
Opening connection to database 'drdb' on server '(localdb)\drdb'.
Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT [d].[dr_num], [d].[status]
FROM [dr_history] AS [d]

@maumar
Copy link
Contributor

maumar commented Nov 25, 2016

Note to Triage/self: could be related to #6937

@myblindy
Copy link
Author

Maybe, but keep in mind the navigation link isn't optional. It used to be optional, but I changed it to just a plain int and it behaves the same in both instances.

@maumar
Copy link
Contributor

maumar commented Apr 13, 2017

This is fixed in the current bits. We produce the following queries:

main:

SELECT [dr].[id], [dr].[assigned], [dr].[ata], [dr].[custsupportref], [dr].[date_required], [dr].[dateofrepro], [dr].[descr1], [dr].[descr2], [dr].[discrepancyid], [dr].[documenttypeid], [dr].[documentversion], [dr].[due_date], [dr].[flightcond], [dr].[load], [dr].[mano], [dr].[priority], [dr].[proj_dr], [dr].[project], [dr].[referencedata], [dr].[relationshipid], [dr].[relationshipto], [dr].[reprodescr], [dr].[reprodoneby], [dr].[reproducible], [dr].[reprotechnicalanalysis], [dr].[reprotrainingdevice], [dr].[softwarelog], [dr].[softwarelogoriginalname], [dr].[softwaretitle], [dr].[tags], [dr].[test_guide]
FROM [dr_dr] AS [dr]
WHERE [dr].[project] IN (1, 2, 3) AND ((
    SELECT TOP(1) [d].[status]
    FROM [dr_history] AS [d]
    WHERE [dr].[id] = [d].[dr_num]
) = 3)
ORDER BY [dr].[proj_dr], [dr].[id]
OFFSET @__p_1 ROWS FETCH NEXT @__p_2 ROWS ONLY

include1:

SELECT [d1].[dr_num], [d1].[hist_num], [d1].[addedfilesgroup], [d1].[assigned], [d1].[attachmentID], [d1].[author], [d1].[date], [d1].[deletedfilesgroup], [d1].[descr], [d1].[enteredby], [d1].[fixedfilesgroup], [d1].[internal], [d1].[log_user_id], [d1].[status], [d1].[version], [d2].[id], [d2].[descr], [d2].[sortid], [d2].[status]
FROM [dr_history] AS [d1]
INNER JOIN (
	SELECT DISTINCT [t0].*
	FROM (
		SELECT [dr].[proj_dr], [dr].[id]
		FROM [dr_dr] AS [dr]
		WHERE [dr].[project] IN (1, 2, 3) AND ((
			SELECT TOP(1) [d].[status]
			FROM [dr_history] AS [d]
			WHERE [dr].[id] = [d].[dr_num]
		) = 3)
		ORDER BY [dr].[proj_dr], [dr].[id]
		OFFSET @__p_1 ROWS FETCH NEXT @__p_2 ROWS ONLY
	) AS [t0]
) AS [dr1] ON [d1].[dr_num] = [dr1].[id]
INNER JOIN [dr_status] AS [d2] ON [d1].[status] = [d2].[id]
ORDER BY [dr1].[proj_dr], [dr1].[id]

collection include:

SELECT [dr.DrHistory].[dr_num], [dr.DrHistory].[hist_num], [dr.DrHistory].[addedfilesgroup], [dr.DrHistory].[assigned], [dr.DrHistory].[attachmentID], [dr.DrHistory].[author], [dr.DrHistory].[date], [dr.DrHistory].[deletedfilesgroup], [dr.DrHistory].[descr], [dr.DrHistory].[enteredby], [dr.DrHistory].[fixedfilesgroup], [dr.DrHistory].[internal], [dr.DrHistory].[log_user_id], [dr.DrHistory].[status], [dr.DrHistory].[version]
FROM [dr_history] AS [dr.DrHistory]
INNER JOIN (
	SELECT [dr0].[id], [dr0].[proj_dr]
	FROM [dr_dr] AS [dr0]
	WHERE [dr].[project] IN (1, 2, 3) AND ((
		SELECT TOP(1) [d0].[status]
		FROM [dr_history] AS [d0]
		WHERE [dr0].[id] = [d0].[dr_num]
	) = 3)
	ORDER BY [dr0].[proj_dr], [dr0].[id]
	OFFSET @__p_1 ROWS FETCH NEXT @__p_2 ROWS ONLY
) AS [t] ON [dr.DrHistory].[dr_num] = [t].[id]
ORDER BY [t].[proj_dr], [t].[id]

@maumar maumar closed this as completed Apr 13, 2017
@maumar maumar added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement and removed type-investigation labels Apr 13, 2017
@ajcvickers ajcvickers changed the title Query with filter on sub-query fails to fully compile in one SQL statement Query: Query with filter on sub-query fails to fully compile in one SQL statement May 9, 2017
@divega divega changed the title Query: Query with filter on sub-query fails to fully compile in one SQL statement Query: Translate querys with filter on sub-query to a single SQL statement May 10, 2017
@ajcvickers ajcvickers modified the milestones: 2.0.0-preview1, 2.0.0 Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

No branches or pull requests

4 participants