Advertisement
MagicAndre1981

Comment: Using Pre-Generated Views

Jan 5th, 2016
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 7.52 KB | None | 0 0
  1. I'm also confused if the view is used or not:
  2.  
  3. - I installed the NuGet package
  4. - the XML is generated
  5.  
  6.  
  7. I captured a ETW trace with WPR.exe before and after activating the view.
  8.  
  9.  
  10. In the callstacks, I see the same calls until EntityFramework.dll!System.Data.Entity.Core.Mapping.StorageMappingItemCollection+ViewDictionary::SerializedGetGeneratedViews.
  11.  
  12.  
  13.  
  14. With the version which uses the views I see those lines:
  15.  
  16. Line #, DPC/ISR, Process, Stack Tag, Stack , Count, TimeStamp, % Weight
  17. 45, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.StorageMappingItemCollection+ViewDictionary::SerializedCollectViewsFromCache, 358, , 0,08
  18. 46, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Infrastructure.MappingViews.DbMappingViewCacheFactory::Create, 353, , 0,07
  19. 47, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- InteractivePreGeneratedViews.dll!InteractivePreGeneratedViews.ViewCacheFactoryBase::GenerateViews, 310, , 0,07
  20. 48, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    EntityFramework.dll!System.Data.Entity.Core.Mapping.StorageMappingItemCollection::GenerateViews, 310, , 0,07
  21. 49, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.StorageMappingItemCollection::GenerateViews, 308, , 0,07
  22.  
  23.  
  24.  
  25. After the last call I got this code:
  26.  
  27. Line #, DPC/ISR, Process, Stack Tag, Stack , Count, TimeStamp, % Weight
  28. 50, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.ViewgenGatekeeper::GenerateViewsFromMapping, 308, , 0,07
  29. 51, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.ViewgenGatekeeper::GenerateViewsFromCells, 283, , 0,06
  30. 52, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.ViewGenerator::GenerateAllBidirectionalViews, 226, , 0,05
  31. 53, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.ViewGenerator::GenerateDirectionalViews, 172, , 0,04
  32. 54, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.ViewGenerator::GenerateDirectionalViewsForExtent, 155, , 0,03
  33. 55, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.ViewGenerator::GenerateViewsForExtentAndType, 125, , 0,03
  34. 56, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.QueryRewriting.QueryRewriter::GenerateViewComponents, 87, , 0,02
  35. 57, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.QueryRewriting.QueryRewriter::EnsureExtentIsFullyMapped, 42, , 0,01
  36. 58, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.QueryRewriting.QueryRewriter::RewriteQuery, 31, , 0,01
  37. 59, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.QueryRewriting.QueryRewriter::RewriteQueryCached, 23, , 0,00
  38. 60, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.QueryRewriting.RewritingProcessor`1[System.__Canon]::RewriteQuery, 18, , 0,00
  39. 61, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.QueryRewriting.RewritingProcessor`1[System.__Canon]::RewriteQueryOnce, 18, , 0,00
  40. 62, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.QueryRewriting.RewritingPass`1[System.__Canon]::RewriteQuery, 15, , 0,00
  41. 63, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.QueryRewriting.RewritingPass`1[System.__Canon]::RewriteQuery, 13, , 0,00
  42. 64, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.QueryRewriting.RewritingSimplifier`1[System.__Canon]::TrySimplifyJoinRewriting, 6, , 0,00
  43. 65, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.QueryRewriting.RewritingSimplifier`1[System.__Canon]::SimplifyRewriting, 5, , 0,00
  44. 66, , , ,   |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |- EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.QueryRewriting.RewritingSimplifier`1[System.__Canon]::SimplifyRewritingOnce, 3, , 0,00
  45.  
  46.  
  47.  
  48.  
  49. and here for both cases the View is generated from the model/mappings:
  50.  
  51. EntityFramework.dll!System.Data.Entity.Core.Mapping.ViewGeneration.ViewgenGatekeeper::GenerateViewsFromMapping
  52.  
  53.  
  54.  
  55. So, I'm also confused if the cached views are used or not.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement