SQL 服务器文件流中的缓冲池

Buffer Pool in SQL Server FileStream

FileStream 的最佳功能之一是:The SQL Server buffer pool is not used; therefore, this memory is available for query processing.

我遇到了一个问题,如果我从 FileStream table 为 return 文件创建存储过程,是否会使用 SQL 服务器缓冲池?是否可以利用 FileStreamT-SQL 和 SP 的优势?

谢谢

如果您只传输 read/write 数据,您将不会获得任何性能优势,因为您只会将数据从 Sql 客户端传输到文件系统并通过其他节点返回(SQL服务器)。但它允许统一您的数据存储并使用单一方法来存储您的不同数据(关系数据或非关系数据)。当然,如果您要在 SQL 服务器内同时处理非关系数据和关系数据,您将获得优势。

如果使用GET_FILESTREAM_TRANSACTION_CONTEXT sql缓冲池不使用。

Accessing FILESTREAM data with Managed API

Accessing FILESTREAM data using Win32 Streaming has a number of advantages over accessing it using TSQL. When accessing FILESTREAM data using TSQL, SQL Server reads the content of the FILESTREAM data file and serves it to the client. SQL Server memory is used for reading the content of the data file. Accessing FILESTREAM data using Win32 Streaming does not use SQL Server memory. In addition it allows the application to take advantage of the Streaming capabilities of the NT File System.

Though accessing FILESTREAM data using Win32 Streaming has a number of advantages, it is a bit complicated to use, compared to the syntax needed to access it from TSQL. Before a client application can access the FILESTREAM data, it needs to find out the logical path that uniquely identifies the given file in the FILESTREAM data store. This can be achieved by using the “PathName” method of a FILESTREAM column. Note that the PathName() function is Case Sensitive. The following example shows how to retrieve the PathName() associated with the FILESTREAM data of a column. https://www.red-gate.com/simple-talk/sql/learn-sql-server/an-introduction-to-sql-server-filestream/

使用缓冲池进行测试,而读取数据使用计数器

SQLServer:缓冲区Manager\Extension页writes/sec

SQLServer:缓冲区Manager\Extension页reads/sec