I’ve tried to create indexes, and see the plan text only have 10 items, but it takes more than 3 secs.
I saw kernTime is high, what is it? how to tune that?
{
“#operator”: “Sequence”,
“#stats”: {
“#phaseSwitches”: 1,
“execTime”: “7.635µs”
},
“~children”: [
{
“#operator”: “Authorize”,
“#stats”: {
“#phaseSwitches”: 3,
“execTime”: “43.331µs”,
“servTime”: “5.571942ms”
},
“privileges”: {
“List”: [
{
“Target”: “default:mybucket”,
“Priv”: 7
}
]
},
“~child”: {
“#operator”: “Sequence”,
“#stats”: {
“#phaseSwitches”: 1,
“execTime”: “10.432µs”
},
“~children”: [
{
“#operator”: “Sequence”,
“#stats”: {
“#phaseSwitches”: 2,
“execTime”: “830.815µs”,
“kernTime”: “210ns”,
“state”: “running”
},
“~children”: [
{
“#operator”: “IndexScan3”,
“#stats”: {
“#itemsOut”: 10,
“#phaseSwitches”: 43,
“execTime”: “159.928µs”,
“kernTime”: “26.448µs”,
“servTime”: “2.408697999s”
},
“as”: “a”,
“index”: “idx-mybucket-test-03”,
“index_id”: “d0b3d6a43e5fc9e0”,
“index_order”: [
{
“keypos”: 0
},
{
“desc”: true,
“keypos”: 1
}
],
“index_projection”: {
“primary_key”: true
},
“keyspace”: “mybucket”,
“limit”: “10”,
“namespace”: “default”,
“offset”: “10”,
“spans”: [
{
“exact”: true,
“range”: [
{
“high”: “"TEST"”,
“inclusion”: 3,
“low”: “"TEST"”
},
{
“inclusion”: 1,
“low”: “null”
},
{
“high”: “2021”,
“inclusion”: 3,
“low”: “2021”
},
{
“high”: “1”,
“inclusion”: 3,
“low”: “1”
},
{
“high”: “"1"”,
“inclusion”: 3,
“low”: “"1"”
}
]
}
],
“using”: “gsi”,
“#time_normal”: “00:02.408”,
“#time_absolute”: 2.408857927
},
{
“#operator”: “Fetch”,
“#stats”: {
“#itemsIn”: 10,
“#itemsOut”: 10,
“#phaseSwitches”: 45,
“execTime”: “178.177µs”,
“kernTime”: “2.408931839s”,
“servTime”: “3.169494ms”
},
“as”: “a”,
“keyspace”: “mybucket”,
“namespace”: “default”,
“#time_normal”: “00:00.003”,
“#time_absolute”: 0.0033476709999999995
},
{
“#operator”: “Sequence”,
“#stats”: {
“#phaseSwitches”: 2,
“execTime”: “1.270778ms”,
“kernTime”: “445ns”,
“state”: “running”
},
“~children”: [
{
“#operator”: “Filter”,
“#stats”: {
“#itemsIn”: 10,
“#itemsOut”: 10,
“#phaseSwitches”: 43,
“execTime”: “867.174µs”,
“kernTime”: “2.412304232s”
},
“condition”: “((((((a
.type_
) = "TEST") and ((a
.transaction_date
) is not missing)) and ((a
.year
) = 2021)) and ((a
.month
) = 1)) and ((a
.number
) = "1"))”,
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.000867174
},
{
“#operator”: “InitialProject”,
“#stats”: {
“#itemsIn”: 10,
“#itemsOut”: 10,
“#phaseSwitches”: 35,
“execTime”: “73.494µs”,
“kernTime”: “2.412735021s”
},
“result_terms”: [
{
“expr”: “self”,
“star”: true
}
],
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.000073494
},
{
“#operator”: “FinalProject”,
“#stats”: {
“#itemsIn”: 10,
“#itemsOut”: 10,
“#phaseSwitches”: 21,
“execTime”: “19.68µs”
},
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.00001968
}
],
“#time_normal”: “00:00.001”,
“#time_absolute”: 0.001270778
}
],
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.000830815
},
{
“#operator”: “Limit”,
“#stats”: {
“#itemsIn”: 10,
“#itemsOut”: 10,
“#phaseSwitches”: 31,
“execTime”: “120.185µs”,
“kernTime”: “2.725989ms”
},
“expr”: “10”,
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.000120185
}
],
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.000010432000000000001
},
“#time_normal”: “00:00.005”,
“#time_absolute”: 0.005615273
},
{
“#operator”: “Stream”,
“#stats”: {
“#itemsIn”: 10,
“#itemsOut”: 10,
“#phaseSwitches”: 23,
“execTime”: “2.88116ms”,
“kernTime”: “2.418879617s”
},
“#time_normal”: “00:00.002”,
“#time_absolute”: 0.00288116
}
],
“~versions”: [
“6.5.0-N1QL”,
“6.5.1-6299-enterprise”
],
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.000007635
}