Database Reference
In-Depth Information
Figure 33-1. Native compilation in SQL Server
The code generated for native compilation uses plain C language and is very efficient. It is very hard to read,
however. For example, every method is implemented as a single function, which does not call other functions but
rather implements its code inline using GOTO as a control flow statement. You should remember the intention has
never been to generate human-readable code. It is used as the source for native compilation only.
Binary DLL files are not persisted in a database backup. SQL Server recreates table-related DLLs on startup and
stored procedures-related DLLs at the time of first call. This approach addresses security risks from hackers, who can
substitute DLLs with malicious copies.
SQL Server places binary DLLs and all other native compilation-related files in an XTP subfolder under the main
SQL Server data directory. It groups files on a per-database basis by creating another level of subfolder. Figure 33-2
shows the content of the folder for the database (with ID=5), which contains one memory-optimized table and two
natively-compiled stored procedures.
 
Search WWH ::




Custom Search