大网数据广告活动
磁盘与文件系统

Long Value Columns

· 52CE 我爱测

Learn more about: Long Value Columns

Applies to: Windows | Windows Server

Long Value Columns

The ESE column types JET_coltypLongText and JET_coltypLongBinary are called long value column types. These columns are large string and large binary objects that may be stored in separate B+ trees away from the primary index. When long values are stored separate from the primary record, they are internally keyed on a long value ID (LID) and byte offset and accessed as a stream. Long value columns are added to the table in the call to JetAddColumn with the coltyp member of the JET_COLUMNDEF structure set to either JET_coltypLongText or JET_coltypLongBinary. The maximum size of a Long Text or Long Binary column value is 2 GB -1.

ESE supports append, byte range overwrite, and set size operations for long value columns to support efficient stream implementations on these column types. By default, long value data is stored in a separate B+ tree if it is larger than 1024 bytes, or if the record does not fit on a single database page when the long value data is stored in the record. The application has the option to override the default behavior by setting options to store long value data in the record (JET_bitSetIntrinsicLV) or to force them to be stored in the separate B+ tree (JET_bitSetSeparateLV). These values are set in the grbit parameter in JetSetColumn, or the grbit member JET_SETCOLUMN used in the call to JetSetColumns as follows:

  • Append: (JET_bitSetAppendLV)

  • Byte Range Overwrite: (JET_bitSetOverwriteLV)

  • Set Size: (JET_bitSetSizeLV)

  • Force Separate: (JET_bitSetSeparateLV)

  • Store In Record: (JET_bitSetIntrinsicLV)

The long value data is set by indicating the offset into the long value blob, and the length of the long value data in the blob. The offset to the long value blob is set in the ibLongValue member of JET_SETINFO structure (for JetSetColumn) or the ibLongValue member of the JET_SETCOLUMN structure (for JetSetColumns). The pvData member of JET_SETCOLUMN, and pvData parameter in the call to JetSetColumn contains the long value data. Updates to long value columns must be performed inside a transaction.

The long value data is always stored in a separate table is when the application sets the JET_bitSetSeparateLV or JET_bitSetIntrinsicLV, otherwise it is heuristically decided. ESE stores the long value separated if it is larger than 1024 bytes or if the record would not fit on a single database page if stored in record.

The following diagram shows the long value data stored in separate table. When a long value is stored outside the record, a new long valued ID is created to refer to its value. This allows multiple records to refer to the same column value. Reference counts to the data are increased if more than one record in the data points to the same long value data.

ESE_Documentation_longvaluedtree2

ESE also supports a single instance store feature that allows multiple records to reference the same large binary object as though each record had its own copy of the information; thus avoiding duplicate copies of the column value data. This feature is enabled in the call to JetPrepareUpdate with the JET_prepInsertCopy option set in the prep parameter.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 04/11/2016
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。