entity framework - EF very slow from a view in certain circumstances: prevent EF to mimic `option(recompile)` -
i use ef6 in winform project
i use query view populate datagridview.
with no condition populate takes 3s (2500 rows).
with specific condition, involving ...where exists(select...)
populate takes 13s (212 rows) (same perf in linqpad).
i read :
that quite similar cases.
in both cases (with , without condition), sql query runs in less 1s in ssms (this makes me think sql query complexity not involved)
my local sql server microsoft sql server 2012 (sp1) - 11.0.3153.0 (x64) jul 22 2014 15:26:36 copyright (c) microsoft corporation express edition (64-bit) on windows nt 6.1 <x64> (build 7601: service pack 1)
i got better performance (less 5s) on distant sql enterprise server.
does mean ef application querying view not adapted express edition ?
where else can understand why ?
===== =====
ef:
ssms:
there factor 10 performance. there must find !
===== =====
i managed degrade performance of ssms @ of ef using option (recompile)
@ end of query in ssms.
how prevent ef mimic option(recompile)
.
===== ===== =====
always hoping ideas right know exec sp_updatestats
seems fix problem.
Comments
Post a Comment