2

I know that row offset array at the end of page stores information about the starting index of any row. Does it also store information about column data? And where does it store? If not, how does it identify the different column data?

asked Mar 21, 2018 at 3:55

2 Answers 2

2

Column meta-data are stored in system catalog tables. These are held separately from the physical record. The meta-data can be queried using the sys.columns catalog view. Records within a data page are a structure that includes a null bitmap, fixed-length fields, variable-length fields, and a column offset array entry for each variable length field present in the record. See Paul Randal's Anatomy of a Record for specifics of the internal data record structure. The physical record structure is significantly different when PAGE or ROW compression is used, for BLOBs (varchar(max) et al), and when a clustered columnstore index exists.

SQL Server uses the schema defined by the column meta-data to determine how to interpret the physical record structure and return the requested column values from the fields in the record. The physical record may or may not contain fields for each column, depending on whether the data type is fixed-length or variable, a NULL value, or columns added after initial table creation.

For example, if one adds a varchar NULL column to an existing table, that is a meta-data only operation that doesn't modify existing physical records. Similarly, adding a NOT NULL column with a default constraint is a meta-data only operation in Enterprise Edition because SQL Server uses meta-data to return the default value for existing rows even though the value is not physically present in records until later modified.

Michael Green
25.3k13 gold badges54 silver badges100 bronze badges
answered Mar 21, 2018 at 10:45
-1

Records are stored in pages. They're stored in a FixedVar format, variable-length columns are stored at the end. The pages themselves are tied sysallocunits which is tied to sysrowsets which is tied sysschobjs which is tied to syscolpairs for schema.

Definitely check out DBCC_PAGE and for more information, check our

All of the information was grabbed from that vid. Seen it a few times now. Haven't played with it yet.

answered Mar 21, 2018 at 5:28

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.