Dapper type mapping hangs in Windows 10 for large queries

与世无争的帅哥 提交于 2019-12-09 19:00:38

问题


I have a very simply query in my projects that returns ~1.3 million rows:

var aliases = ctx.Query<sec_entity_alias>(@"select * from sec_entity_alias");

The class that is mapped to is:

    public partial class sec_entity_alias
{
    public int id { get; set; }
    public int sec_entity_id { get; set; }
    public byte sec_entity_alias_type_id { get; set; }
    public string symbol { get; set; }

    public virtual sec_entity_alias_type sec_entity_alias_type { get; set; }
}

When I run the query it hangs indefinitely and pegs the CPU. When I remove the dapper type mapping and instead run the following, the query returns all rows in ~200ms

var aliases = ctx.Query(@"select * from sec_entity_alias");

This issue suddenly started appearing today after I upgraded to Windows 10 from Windows 8.1

Has anyone else noticed this issue or am I missing something apparent here?

EDIT:

I just ran the same code on a Windows'12 R2 server and it ran completely fine.

Below is a profiling session where spends the most time on the Windows 10 machine.

Another interesting tidbit: when I create a new project and only query the sec_entity_alias table it works fine but in my main project where I load some other tables first is where it encounters the issue.

来源:https://stackoverflow.com/questions/31736666/dapper-type-mapping-hangs-in-windows-10-for-large-queries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!