缓慢的结合和结束 [英] slow union and concat

查看:109
本文介绍了缓慢的结合和结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个问题

var one;

var two;

实际上查询有点复杂并且包含太多的业务逻辑以便于现在发布。

The actually queries are a little complicated and contain too much business logic to easily post now.

 

但是以下工作正常。

one.toList();

one.toList();

int onec = one.count();

int onec = one.count();

两个相同。

但是如果我这样做

var both = one.union(two);

var both = one.union(two);

both.toList(返回时需要花费一个多小时。

both.toList() takes well over an hour to return.

与concat相同的事情。

Same thing with concat.

那么为什么每个查询都单独返回,但联盟似乎是杀死应用程序?

So why are each queries returning fine individually yet the union seems to be killing the app?

 

推荐答案

嗨拉尔夫,

 

乍一看,我看不出为什么会这么慢。

At first glance, I cannot see why could it be slow.

您是否尝试检查SQL查询运行以获取"both"?

Have you tried to examine the SQL query running to get the "both"?

SQL查询的执行是否可能长时间运行?

Is it possible the execution of the SQL query runs for a long time?

 

(您可以启用loggi通过设置Datacontext的Log属性来获取SQL查询。例如:
myDataContext.Log = Console.Out;)

(You can enable the logging for the SQL queries with setting the Log property of the Datacontext. e.g.: myDataContext.Log = Console.Out;)

 




这篇关于缓慢的结合和结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆