MAPPING TABLE 的作用

本文解释了Oracle中索引组织表(IOT)的概念及如何使用映射表(mapping table)来支持位图索引。映射表作为一个堆组织表,存储了IOT的逻辑行ID,确保了位图索引能够稳定地引用数据行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

MAPPING TABLE 的作用  

Oracle supports bitmap indexes on partitioned and nonpartitioned index-organized tables.A mapping table is required for creating bitmap indexes on an index-organized table.

Mapping TableThe mapping table is a heap-organized table that stores logical rowids of the index-organized table. Specifically,each mapping table row stores one logical rowid for the corresponding index-organized table row. Thus,the mapping table provides one-to-one mapping between logical rowids of the index-organized table rows and physical rowids of the mapping table rows.

A bitmap index on an index-organized table is similar to that on a heap-organized table except that the rowids used in the bitmap index on an index-organized table are those of the mapping table as opposed to the base table. There is one mapping table for each index-organized table and it is used by all the bitmap indexes created on that index-organized table.

In both heap-organized and index-organized base tables, a bitmap index is accessed using a search key. If the key is found, the bitmap entry is converted to a physical rowid. In the case of heap-organized tables, this physical rowid is then used to access the base table. However, in the case of index-organized tables, the physical rowid is then used to access the mapping table. The access to the mapping table yields a logical rowid. This logical rowid is used to access the index-organized table.

Though a bitmap index on an index-organized table does not store logical rowids, it is still logical in nature.

你创建了一个IOT 表,想在上面的其中一列建立位图索引,你必须建立一
个mapping table
注意到Mapping table 是个heap table, 用来存储IOT table 的logical
rowid (primary key)。 Mapping table 的每一行存储了对应的IOT 表中记录
的logical rowid.
因此这个mapping table 就维护了IOT 表logical rowid 和 mapping table
的每一行的physical rowid 的mapping 的关系。为什么要这样做呢?
因为bitmap 索引条目中保存的rowid 要用physical rowid, 而IOT 是无法
提供稳定的physical rowid 的,因此就借助于mapping table 的physical rowid。
通过bitmap 索引来访问表中的数据的执行计划大概就是首先根据bitmap
index 中的physical rowid 访问mapping table, 然后通过mapping table 中的
logical rowid 再来访问IOT 表。

<think>好的,用户让我介绍一下HID report mapping table。首先,我需要确认自己对HID的理解是否正确。HID是Human Interface Device的缩写,属于USB设备类别的一种,常见于键盘、鼠标、游戏手柄等。而report descriptor是HID设备用来描述其数据传输格式的,这样主机(比如电脑)就知道如何解析设备发来的数据。 接下来,HID report mapping table应该是指报告描述符中的映射表,用于将设备的物理输入(如按键、轴移动)映射到报告中的数据位。需要解释报告描述符的结构,包括用途和各个字段的作用,比如Usage Page、Usage、Logical Minimum/Maximum等。 可能用户是开发人员,正在开发HID设备,需要了解如何配置报告描述符,或者是在处理HID设备的数据解析问题。需要确保解释清晰,结合实际例子,比如键盘的按键如何映射到报告中的字节,或者游戏手柄的摇杆轴如何表示。 需要检查是否有专业术语需要进一步解释,比如Usage ID、Report Size等,避免用户混淆。同时,要注意结构,分点说明组成部分和功能,并举例说明,帮助用户理解抽象概念。最后确认回答是否符合之前的系统指令,使用中文,数学公式正确应用,如果有的话,但这里可能用不上公式,更多是数据结构说明。</think>HID报告映射表(HID Report Mapping Table)是**人机接口设备(HID)协议中的核心数据结构**,用于定义设备与主机之间的数据通信格式。其本质是一个二进制描述符(Report Descriptor),通过特定语法描述设备功能与数据报告的映射关系。 ### 核心组成部分 1. **Usage Page** 定义设备功能大类(如`0x01`=通用桌面控制,`0x06`=键盘/键区)。 2. **Usage ID** 指定具体功能(如`0x30`=X轴,`0xE0`=左Ctrl键)。 3. **Report Size** 单个数据字段的比特数(例如`8`位表示0-255范围)。 4. **Report Count** 相同类型字段的重复次数(如6个字节表示6个同时按下的键盘按键)。 5. **Logical Range** 逻辑值范围(如`Logical Minimum=0`, `Logical Maximum=100`表示摇杆百分比)。 ### 典型示例(键盘报告描述符片段) ```c Usage Page (0x07), // 键盘/键区 Usage Minimum (0xE0), // 左Ctrl键 Usage Maximum (0xE7), // Right GUI键(Win键) Logical Minimum (0), Logical Maximum (1), Report Size (1), // 1bit表示按键状态 Report Count (8), // 8个修饰键(Ctrl/Alt/Shift等) Input (Data,Var,Abs), // 输入报告,变量类型 Report Size (8), Report Count (6), // 6个普通按键 Input (Data,Array,Abs) // 数组形式表示按键码 ``` 该结构定义了一个包含: - 8个1-bit的修饰键(如Ctrl/Shift) - 6个8-bit的普通按键(如A/B/C键码) ### 关键特性 - **动态解析**:主机通过解析描述符动态生成驱动 - **位级压缩**:支持按位打包数据(如用1bit表示布尔值) - **多层嵌套**:通过`Collection`实现复杂设备结构描述(如物理/逻辑集合) 实际应用中,游戏手柄可能用`0x30`/`0x31`表示X/Y轴,VR控制器可能包含`0x84`=姿态四元数字段。理解该映射表是开发HID设备固件或实现跨平台HID解析的关键。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值