How do I reduce the amount of SQL created by entity Framework? -


After the

I write the LINQ piece Private IQueryable & LT for the following EE ... VRTSystem & gt; GetObjectSetWithIncludes () {return GetObjectSet () .clude (s => s.Site.Address.GeographicalLocation.ParentLocation.ParentLocation) .include (s => gt; s.Dhr.Select (d = & gt; d.DhrParts .Select (DP = & gt; dp.PhysicalPart.PartDefinition))) .Include (s = & gt; s.Room.RoomType) .Include (s = & gt; s.ProductConfiguration.ProductConfigurations_PriceBook.Select (pcpb = & Gt; pcpb.PriceBook)). .Include (s = & gt; s.ProductConfigurationTemplate) .Include (s = & gt; s.Customer.GeographicalLocation.ParentLocation.ParentLocation) .Include (s = & gt; (s.ProductConfiguration.Quote_ProductConfigurations s = & gt) include Do s.Customer .CustomerType) .Include (s = & gt; s.HospitalGroupCustomer.GeographicalLocation.ParentLocation.ParentLocation) .Include (s = & gt; s.HospitalGroupCustomer.CustomerType) .Include (s = & gt; s.ServiceCoverHistories .Select (sch = & gt; Sch.ServiceCoverLevel)) is included (S = & gt; s.SystemSt Atus). Include (s => gtc: s.ShippingContact.Address) .include (s => s.quote) .include (s => s.PaidDate) .include (s => s.VRTSystemProductConfigurations. Select (SPC = & gt; spc.ProductConfigurationTemplate.ProductConfigurations_PriceBook .Select (pcpb = & gt; pcpb.PriceBook))) .Include (s = & gt; s.VRTSystemProductConfigurations .Select (SPC = & gt; spc.PaidDate)) .include (s = Quote_ProductConfigurations.Select (SPC = & Gt; spc.ProductConfiguration). (S = & gt; s.ProductConfigurationTemplate .Product Configuration Options. Select (pco = & gt; pco. ProductConfigurationOptionValues).) (S => S.SystemProductConfigurationOptionsSelectedValues) Include (S => .VRTSystemProductConfigurations. Select (SPC = >;)}

Because lazy loading is off, we are sending results out of WCF, and therefore need to load all the data immediately, besides, The WPF window needs all of those related tables that will be used in the data.

It is working fine for ages, but suddenly there were several tables in an exception query that started throwing. I saw that SQL was generated, and it was about 20,000 lines, and more than 600 to join! I'm not surprised to throw an exception with that amount of SQL!

I'm really sure why it is so many that, not seeing that the query is not referred anywhere near that number of table.

Why can anybody think that this exception starts throwing abruptly, and what can I do to improve this question? I think the best answer to split down into this little question may be to write some major rewrites but apart from that, I need a quick improvement, the deployed system does not work anymore From the complexity of, and we need to get it running immediately.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -