Got it. Here is the plan for the first query:
{
“#operator”: “Sequence”,
“#stats”: {
“#phaseSwitches”: 1,
“execTime”: “1.5µs”
},
“~children”: [
{
“#operator”: “Authorize”,
“#stats”: {
“#phaseSwitches”: 3,
“execTime”: “2.5µs”,
“servTime”: “937.1µs”
},
“privileges”: {
“List”: [
{
“Target”: “default:trips”,
“Priv”: 7
}
]
},
“~child”: {
“#operator”: “Sequence”,
“#stats”: {
“#phaseSwitches”: 1,
“execTime”: “1.9µs”
},
“~children”: [
{
“#operator”: “Sequence”,
“#stats”: {
“#phaseSwitches”: 2,
“execTime”: “452.399µs”,
“kernTime”: “200ns”,
“state”: “running”
},
“~children”: [
{
“#operator”: “DistinctScan”,
“#stats”: {
“#itemsIn”: 199,
“#itemsOut”: 199,
“#phaseSwitches”: 801,
“execTime”: “130.9µs”,
“kernTime”: “1.960698ms”
},
“scan”: {
“#operator”: “IndexScan3”,
“#stats”: {
“#itemsOut”: 199,
“#phaseSwitches”: 801,
“execTime”: “438.699µs”,
“kernTime”: “49.1µs”,
“servTime”: “1.374499ms”
},
“index”: “idx_test_tags”,
“index_id”: “d08290d19ee16ead”,
“index_order”: [
{
“desc”: true,
“keypos”: 0
}
],
“index_projection”: {
“primary_key”: true
},
“keyspace”: “trips”,
“namespace”: “default”,
“spans”: [
{
“exact”: true,
“range”: [
{
“high”: "“9999-12-31T23:59:59.9999999+00:00"”,
“inclusion”: 1,
“low”: "“0001-01-01T00:00:00.0000000+00:00"”
}
]
}
],
“using”: “gsi”,
“#time_normal”: “00:00.001”,
“#time_absolute”: 0.001813198
},
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.0001309
},
{
“#operator”: “Fetch”,
“#stats”: {
“#itemsIn”: 33,
“#itemsOut”: 16,
“#phaseSwitches”: 103,
“execTime”: “620.199µs”,
“kernTime”: “2.103898ms”,
“servTime”: “2.742499ms”,
“state”: “running”
},
“keyspace”: “trips”,
“namespace”: “default”,
“#time_normal”: “00:00.003”,
“#time_absolute”: 0.003362698
},
{
“#operator”: “Sequence”,
“#stats”: {
“#phaseSwitches”: 2,
“execTime”: “600.999µs”,
“kernTime”: “100ns”,
“state”: “running”
},
“~children”: [
{
“#operator”: “Filter”,
“#stats”: {
“#itemsIn”: 16,
“#itemsOut”: 16,
“#phaseSwitches”: 67,
“execTime”: “640.3µs”,
“kernTime”: “4.275897ms”
},
“condition”: “((((“0001-01-01T00:00:00.0000000+00:00” <= (trips
.startTs
)) and ((trips
.startTs
) < “9999-12-31T23:59:59.9999999+00:00”)) and ((trips
.tags
) is valued)) and ((trips
.type
) = “trip”))”,
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.0006403
},
{
“#operator”: “InitialProject”,
“#stats”: {
“#itemsIn”: 2,
“#itemsOut”: 1,
“#phaseSwitches”: 8,
“execTime”: “36.4µs”,
“kernTime”: “4.872497ms”
},
“raw”: true,
“result_terms”: [
{
“expr”: “trips
”
}
],
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.0000364
},
{
“#operator”: “FinalProject”,
“#stats”: {
“#itemsIn”: 1,
“#itemsOut”: 1,
“#phaseSwitches”: 6,
“execTime”: “2.5µs”,
“kernTime”: “100ns”
},
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.0000025
}
],
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.0006009990000000001
}
],
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.000452399
},
{
“#operator”: “Limit”,
“#stats”: {
“#itemsIn”: 1,
“#itemsOut”: 1,
“#phaseSwitches”: 5,
“execTime”: “5.6µs”,
“kernTime”: “900ns”
},
“expr”: “1”,
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.0000056
}
],
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.0000018999999999999998
},
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.0009396000000000001
},
{
“#operator”: “Stream”,
“#stats”: {
“#itemsIn”: 1,
“#itemsOut”: 1,
“#phaseSwitches”: 5,
“execTime”: “141.199µs”,
“kernTime”: “6.047297ms”
},
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.000141199
}
],
“~versions”: [
“6.5.0-N1QL”,
“6.5.1-6299-enterprise”
],
“#time_normal”: “00:00.000”,
“#time_absolute”: 0.0000015
}
In the fetch step, items in is 33 and items out is 16. You are saying this does not mean Couchbase would transfer 16 documents from the data node to the query node?