I was wondering the same thing and doing digging.
As far as I can tell, the generated class file contains an assembly level attribute, EntityViewGenerationAttribute
, which defines the type of class that contains the precompiled view. Then, and here, only making reasonable assumptions, during compilation, the class must be loaded through reflection and somehow connected with the requests that the view defines. Perhaps in the ESQL cache, which will make some sense.
Although the view is precompiled, they only produce ESQL, not the actual TSQL that will be launched. However, preliminary compilation of views allows you to execute a query to skip the validation phase and ESQL, which should provide a slight performance boost, especially for large compiled queries.
source share