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

bug:跨表 Group By 结果未达到预期数据 #281

Open
Developer-echo opened this issue Sep 26, 2024 · 2 comments
Open

bug:跨表 Group By 结果未达到预期数据 #281

Developer-echo opened this issue Sep 26, 2024 · 2 comments

Comments

@Developer-echo
Copy link

4a30071245d74167e5bf4fe640d88e01

8de0646a7e34d6dc2b62c2cd834a6aba

85adcd378ce35ca3702a1cc376dbfeb6

@Developer-echo
Copy link
Author

版本:7.7.1.21

EF Core 7

@Developer-echo
Copy link
Author

log

[18:38:49 DBG] compile parameter:query entity types :Xzkj.Hhcx.Carpool.Ass,is no tracking: ,is ignore filter :False,is not support :False,max query connections limit:,connection mode:,readonly:,as route:False,is sequence:,same with sharding comparer:
[18:38:49 DBG] queryable combine:ShardingCore.Sharding.ShardingExecutors.QueryableCombines.EnumerableQueryableCombine
[18:38:49 DBG] queryable combine before:DbSet<Ass>()
    .Where(ass => ass.CreateTime > <>c__DisplayClass3_0.time && ass.UserId == (Guid?)<>c__DisplayClass3_0.uid)
    .GroupBy(ass => new { 
        StartCity = ass.StartCity, 
        EndCity = ass.EndCity
     })
    .Select(g => new { 
        StartCity = g.Key.StartCity, 
        EndCity = g.Key.EndCity, 
        Total = g
            .Count()
     })
[18:38:49 DBG] queryable combine after:DbSet<Ass>()
    .Where(ass => ass.CreateTime > <>c__DisplayClass3_0.time && ass.UserId == (Guid?)<>c__DisplayClass3_0.uid)
    .GroupBy(ass => new { 
        StartCity = ass.StartCity, 
        EndCity = ass.EndCity
     })
    .Select(g => new { 
        StartCity = g.Key.StartCity, 
        EndCity = g.Key.EndCity, 
        Total = g
            .Count()
     })
[18:38:49 DBG] data source route result:4d14c2e882a94a4abbddb9d3c055f47a
[18:38:49 DBG] table route results:DataSourceName:4d14c2e882a94a4abbddb9d3c055f47a,TableRouteResult:(has different tail:False,current table:[4d14c2e882a94a4abbddb9d3c055f47a.2023.Xzkj.Hhcx.Carpool.Ass]),DataSourceName:4d14c2e882a94a4abbddb9d3c055f47a,TableRouteResult:(has different tail:False,current table:[4d14c2e882a94a4abbddb9d3c055f47a.2024.Xzkj.Hhcx.Carpool.Ass])
[18:38:49 DBG] rewrite queryable pagination context:[Skip: ,  Take: ]
[18:38:49 DBG] rewrite queryable order by context:[]
[18:38:49 DBG] rewrite queryable group by context:[ass => new { 
    StartCity = ass.StartCity, 
    EndCity = ass.EndCity
 }]
[18:38:49 DBG] rewrite queryable select context:[OwnerType: <>f__AnonymousType3`3[System.String,System.String,System.Int32], Property: System.String StartCity, PropertyName: StartCity,OwnerType: <>f__AnonymousType3`3[System.String,System.String,System.Int32], Property: System.String EndCity, PropertyName: EndCity,OwnerType: <>f__AnonymousType3`3[System.String,System.String,System.Int32], Property: Int32 Total, PropertyName: Total]
[18:38:49 INF] Executed DbCommand (24ms) [Parameters=[@__p_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30']
SELECT TOP(@__p_0) [a].[Id], [a].[CreationTime], [a].[EventData], [a].[EventName], [a].[ExtraProperties]
FROM [AbpEventOutbox] AS [a]
ORDER BY [a].[CreationTime]
[18:38:49 DBG] Server carpool-main:80034:0b310db7 heartbeat successfully sent
[18:38:49 INF] Executed DbCommand (61ms) [Parameters=[@__time_0='?' (DbType = DateTime), @__uid_1='?' (DbType = Guid)], CommandType='Text', CommandTimeout='30']
SELECT [a].[StartCity], [a].[EndCity], COUNT(*) AS [Total]
FROM [Ass_2023] AS [a]
WHERE [a].[CreateTime] > @__time_0 AND [a].[UserId] = @__uid_1
GROUP BY [a].[StartCity], [a].[EndCity]
ORDER BY [a].[StartCity], [a].[EndCity]

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

No branches or pull requests

1 participant