The detailed access plan on the data node includes the following:
- Access plan information on the data node
- Cache usage of access plan
- Access plan information of the main and child tables in the vertical partition involved
Detailed access plan for the main table
The detailed access plan structure of the main table is as follows:
{
{ 主表的访问计划信息 },
"PlanPath": {
"Operator": "MERGE",
{ 主表查询上下文的访问计划信息 },
"ChildOperators": [
{
{ 子表的访问计划信息 },
...
},
...
]
}
}
Copy
The main table access plan includes the following information:
Field name | Types of | description |
---|---|---|
NodeName | String | The name of the node where the access plan is located |
GroupName | String | The name of the replication group to which the node where the access plan belongs |
Role | String | The role of the node where the access plan is located, "data" represents the coordination node |
Collection | String | The name of the collection accessed by the access plan |
Query | BSON object | User query conditions after access plan analysis |
Sort | BSON object | Sort field in access plan |
Selector | BSON object | Access plan execution selector |
Hint | BSON object | The specified query in the access plan uses the index |
Skip | Long integer | The number of records to be skipped in the access plan |
Return | Long integer | The maximum number of records returned by the access plan |
Flag | Integer | The execution flag specified in the access plan, the default value is 0 |
ReturnNum | Long integer | The number of records returned by the access plan |
ElapsedTime | Floating point | Access plan query time (unit: second) |
IndexRead | Long integer | The number of index records scanned by the access plan |
DataRead | Long integer | Number of scan data records of access plan |
UserCPU | Floating point | Access plan user mode CPU usage time (unit: second) |
SysCPU | Floating point | Access plan kernel mode CPU usage time (unit: second) |
PlanPath | BSON object | The specific execution of the access plan MERGE |
Note:
MERGE contains the access plan of the child table, that is, the access plan of the ordinary collection on the data node
Example:
{
"NodeName": "hostname:11820",
"GroupName": "group",
"Role": "data",
"Collection": "maincs.maincl",
"Query": {},
"Sort": {
"a": 1
},
"Selector": {},
"Hint": {},
"Skip": 0,
"Return": -1,
"Flag": 2048,
"ReturnNum": 50000,
"ElapsedTime": 1.225226,
"IndexRead": 0,
"DataRead": 50000,
"UserCPU": 0.5399999999999991,
"SysCPU": 0.02000000000000002,
"PlanPath": {
"Operator": "MERGE",
...
}
}
Copy
Detailed access plan for general collection or sub-table
The detailed access plan structure of a common set or sub-table is as follows:
{
{ 集合的访问计划信息 },
"PlanPath": {
{ 查询上下文的访问计划信息 }
...
}
}
Copy
The visit plan includes the following information:
Field name | Types of | description |
---|---|---|
NodeName | String | The name of the node where the access plan is located |
GroupName | String | The name of the replication group to which the node where the access plan belongs |
Role | String | The role of the node where the access plan is located, "data" means the data node |
Collection | String | The name of the collection accessed by the access plan |
Query | BSON object | User query conditions after access plan analysis |
Sort | BSON object | Sort field in access plan |
Selector | BSON object | Access plan execution selector |
Hint | BSON object | The specified query in the access plan uses the index |
Skip | Long integer | The number of records to be skipped in the access plan |
Return | Long integer | The maximum number of records returned by the access plan |
Flag | Integer | The execution flag specified in the access plan, the default value is 0 |
ReturnNum | Long integer | The number of records returned by the access plan |
ElapsedTime | Floating point | Access plan query time (unit: second) |
IndexRead | Long integer | The number of index records scanned by the access plan |
DataRead | Long integer | Number of scan data records of access plan |
UserCPU | Floating point | Access plan user mode CPU usage time (unit: second) |
SysCPU | Floating point | Access plan kernel mode CPU usage time (unit: second) |
CacheStatus | String | Cache status of the access plan: 1. "NoCache" is not added to the cache 2. "NewCache" is the newly created cache 3. "HitCache" is the hit cache |
MainCLPlan | Boolean | Whether the access plan is a query plan shared by the main table |
CacheLevel | String | 访问计划的缓存级别:1. "OPT_PLAN_NOCACHE" 为不进行缓存 2. "OPT_PLAN_ORIGINAL" 为缓存原查询计划 3. "OPT_PLAN_NORMALZIED" 为缓存泛化后的查询计划 4. "OPT_PLAN_PARAMETERIZED" 为缓存参数化的查询计划,"OPT_PLAN_FUZZYOPTR" 为缓存参数化并带操作符模糊匹配的查询计划 |
Parameters | 数组类型 | 参数化的访问计划使用的参数列表 |
MatchConfig | BSON 对象 | 访问计划中的匹配符的配置 |
MatchConfig.EnableMixCmp | 布尔型 | 访问计划的匹配符是否使用混合匹配模式 |
MatchConfig.Parameterized | 布尔型 | 访问计划的匹配符是否支持参数化 |
MatchConfig.FuzzyOptr | 布尔型 | 访问计划的匹配符是否支持模糊匹配 |
PlanPath | BSON 对象 | 访问计划的具体执行操作 SORT、TBSCAN 或 IXSCAN |
Search | BSON 对象 | 查询计划优化器搜索过的访问计划 Search 选项为 true 时显示 请参考基于代价的访问计划评估 |
Note:
数据节点上的主表的访问计划请参考主表的访问计划
示例:
{
"NodeName": "hostname:11820",
"GroupName": "group",
"Role": "data",
"Collection": "sample.employee",
"Query": {
"a": {
"$gt": 100
}
},
"Sort": {},
"Selector": {},
"Hint": {},
"Skip": 0,
"Return": -1,
"Flag": 2048,
"ReturnNum": 0,
"ElapsedTime": 0.000093,
"IndexRead": 0,
"DataRead": 0,
"UserCPU": 0,
"SysCPU": 0,
"CacheStatus": "HitCache",
"MainCLPlan": false,
"CacheLevel": "OPT_PLAN_PARAMETERIZED",
"Parameters": [
100
],
"MatchConfig": {
"EnableMixCmp": false,
"Parameterized": true,
"FuzzyOptr": false
},
"PlanPath": {
...
}
更多信息请访问巨杉数据库官网