DooDoo
DooDoo

Reputation: 13467

SQL Server behavior with XML columns

I have some question about XML columns:

  1. when we selecting a XML column and we want to fetch some values (using XPath) from its xml contains and perform some operations, does SQL Server read first row and get xml document from hard disk to RAM and perform operation and next fetch next row and so on?

  2. if we want bring ALL content of xml column to RAM, what we can do?

thanks

Upvotes: 2

Views: 144

Answers (1)

Andrew
Andrew

Reputation: 27294

This is getting into SQL Server Internals - SQL Server doesn't read individuals values into RAM, it reads 8k Pages into memory which is how the data is structured on the disk (and the in memory). Your data is stored on one or more of these pages. (I'm keeping this simplified)

If you want to get to understand about how SQL works under the covers, I would recommend the Kalen Delaney - SQL Server Internals book.

Upvotes: 3

Related Questions