Description
This query:
SELECT t_2.* FROM multiple_table_db_8666_simple_table_4 t_2 LEFT JOIN multiple_table_db_8666_simple_table_2 t_1 ON ( (t_2.varchar_field1 <> t_1.varchar_field1 AND t_2.decimal_field1 = t_1.decimal_field1) ) LEFT JOIN multiple_table_db_8666_simple_table_3 t_5 ON ( t_2.primary_key_id = t_5.primary_key_id ) INNER JOIN multiple_table_db_8666_simple_table_1 t_3 ON ( NOT ((t_5.varchar_field1 = t_3.varchar_field1 AND t_5.int_field1 = t_3.int_field1)) ) WHERE NOT (((t_3.bool_field1 != true OR t_3.decimal_field1 BETWEEN 7 and 9998)) AND (t_1.bool_field1 = true) OR ((t_5.varchar_field1 > "bNscBvFIXt") OR (t_5.primary_key_id >= "549")) AND (NOT (t_2.bool_field1))) LIMIT 100
Eventually returns this error (if called through rest), on the standard join setup:
"errors": [
{"code":5000,"msg":"queryport.connPoolTimeout from [127.0.0.1:9101] - cause: queryport.connPoolTimeout from [127.0.0.1:9101]"}
,
{"code":5000,"msg":"queryport.connPoolTimeout from [127.0.0.1:9101] - cause: queryport.connPoolTimeout from [127.0.0.1:9101]"}
,
{"code":5000,"msg":"queryport.connPoolTimeout from [127.0.0.1:9101] - cause: queryport.connPoolTimeout from [127.0.0.1:9101]"}
,
{"code":5000,"msg":"queryport.connPoolTimeout from [127.0.0.1:9101] - cause: queryport.connPoolTimeout from [127.0.0.1:9101]"}
]
If run through the UI the query node seems to crash, and you get this error trying to cancel the query.
Error cancelling query: {"data":null,"status":-1,"config":{"method":"POST","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"../_p/query/query/service","headers":
{"Content-Type":"application/json","ns-server-proxy-timeout":600000,"ignore-401":"true","CB-User-Agent":"Couchbase Query Workbench (5.5.0-1610-enterprise)","Accept":"application/json, text/plain, /","invalid-auth-response":"on","Cache-Control":"no-cache","Pragma":"no-cache","ns-server-ui":"yes"}
,"data":
{"statement":"delete from system:active_requests where clientContextID = \"1db8838a-7d72-4d00-9a0f-3db006e4a8b3\";","pretty":true}
,"timeout":{"$$state":{"status":0,"pending":[[\{"$$state":\{"status":0}},null,null,null]]}}},"statusText":""}
Here is the explain for the query:
{
"plan": {
"#operator": "Sequence",
"~children": [
{
"#operator": "Sequence",
"~children": [
{ "#operator": "PrimaryScan", "as": "t_2", "index": "#primary", "keyspace": "multiple_table_db_8666_simple_table_4", "namespace": "default", "using": "gsi" }
,
{ "#operator": "Fetch", "as": "t_2", "keyspace": "multiple_table_db_8666_simple_table_4", "namespace": "default" }
,
{
"#operator": "Parallel",
"~child": {
"#operator": "Sequence",
"~children": [
{
"#operator": "AnsiJoin",
"alias": "t_1",
"on_clause": "((not ((`t_2`.`varchar_field1`) = (`t_1`.`varchar_field1`))) and ((`t_2`.`decimal_field1`) = (`t_1`.`decimal_field1`)))",
"outer": true,
"~child": {
"#operator": "Sequence",
"~children": [
{
"#operator": "UnionScan",
"scans": [
{
"#operator": "IntersectScan",
"scans": [
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_1",
"index": "simple_table_2_decimal_field1",
"index_id": "83f850fe4d7a2213",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_2",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "(`t_2`.`decimal_field1`)", "inclusion": 3, "low": "(`t_2`.`decimal_field1`)" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_1",
"index": "simple_table_2_varchar_field1",
"index_id": "91abfeb3513bb5d4",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_2",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "inclusion": 0, "low": "(`t_2`.`varchar_field1`)" }
]
}
],
"using": "gsi"
}
]
},
{
"#operator": "IntersectScan",
"scans": [
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_1",
"index": "simple_table_2_decimal_field1",
"index_id": "83f850fe4d7a2213",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_2",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "(`t_2`.`decimal_field1`)", "inclusion": 3, "low": "(`t_2`.`decimal_field1`)" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_1",
"index": "simple_table_2_varchar_field1",
"index_id": "91abfeb3513bb5d4",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_2",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "(`t_2`.`varchar_field1`)", "inclusion": 0, "low": "null" }
]
}
],
"using": "gsi"
}
]
}
]
},
{ "#operator": "Fetch", "ansi_join": true, "as": "t_1", "keyspace": "multiple_table_db_8666_simple_table_2", "namespace": "default" }
]
}
},
{
"#operator": "AnsiJoin",
"alias": "t_5",
"on_clause": "((`t_2`.`primary_key_id`) = cover ((`t_5`.`primary_key_id`)))",
"outer": true,
"~child": {
"#operator": "Sequence",
"~children": [
{
"#operator": "DistinctScan",
"scan": {
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_5",
"covers": [
"cover ((`t_5`.`primary_key_id`))",
"cover ((`t_5`.`bool_field1`))",
"cover ((`t_5`.`char_field1`))",
"cover ((`t_5`.`datetime_field1`))",
"cover ((`t_5`.`decimal_field1`))",
"cover ((`t_5`.`int_field1`))",
"cover ((`t_5`.`varchar_field1`))",
"cover ((meta(`t_5`).`id`))"
],
"index": "simple_table_3",
"index_id": "448c7c8c1b857ae6",
"index_projection":
{ "entry_keys": [ 0, 5, 6 ], "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_3",
"namespace": "default",
"spans": [
{
"range": [
{ "high": "(`t_2`.`primary_key_id`)", "inclusion": 3, "low": "(`t_2`.`primary_key_id`)" }
]
},
{
"exact": true,
"range": [
{ "high": "(`t_2`.`primary_key_id`)", "inclusion": 3, "low": "(`t_2`.`primary_key_id`)" }
]
}
],
"using": "gsi"
}
}
]
}
},
{
"#operator": "AnsiJoin",
"alias": "t_3",
"on_clause": "(not ((cover ((`t_5`.`varchar_field1`)) = (`t_3`.`varchar_field1`)) and (cover ((`t_5`.`int_field1`)) = (`t_3`.`int_field1`))))",
"~child": {
"#operator": "Sequence",
"~children": [
{
"#operator": "UnionScan",
"scans": [
{
"#operator": "IntersectScan",
"scans": [
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_varchar_field1",
"index_id": "34a6ef0683ca3cc7",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "inclusion": 0, "low": "cover ((`t_5`.`varchar_field1`))" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_decimal_field1",
"index_id": "1b92975b5eb575a9",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "7", "inclusion": 0, "low": "null" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_bool_field1",
"index_id": "21acda90edc9bfd7",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "true", "inclusion": 3, "low": "true" }
]
}
],
"using": "gsi"
}
]
},
{
"#operator": "IntersectScan",
"scans": [
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_decimal_field1",
"index_id": "1b92975b5eb575a9",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "7", "inclusion": 0, "low": "null" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_bool_field1",
"index_id": "21acda90edc9bfd7",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "true", "inclusion": 3, "low": "true" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_varchar_field1",
"index_id": "34a6ef0683ca3cc7",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "cover ((`t_5`.`varchar_field1`))", "inclusion": 0, "low": "null" }
]
}
],
"using": "gsi"
}
]
},
{
"#operator": "IntersectScan",
"scans": [
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_int_field1",
"index_id": "af0e6940ccd42871",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "inclusion": 0, "low": "cover ((`t_5`.`int_field1`))" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_decimal_field1",
"index_id": "1b92975b5eb575a9",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "7", "inclusion": 0, "low": "null" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_bool_field1",
"index_id": "21acda90edc9bfd7",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "true", "inclusion": 3, "low": "true" }
]
}
],
"using": "gsi"
}
]
},
{
"#operator": "IntersectScan",
"scans": [
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_bool_field1",
"index_id": "21acda90edc9bfd7",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "true", "inclusion": 3, "low": "true" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_int_field1",
"index_id": "af0e6940ccd42871",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "cover ((`t_5`.`int_field1`))", "inclusion": 0, "low": "null" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_decimal_field1",
"index_id": "1b92975b5eb575a9",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "7", "inclusion": 0, "low": "null" }
]
}
],
"using": "gsi"
}
]
},
{
"#operator": "IntersectScan",
"scans": [
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_varchar_field1",
"index_id": "34a6ef0683ca3cc7",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "inclusion": 0, "low": "cover ((`t_5`.`varchar_field1`))" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_decimal_field1",
"index_id": "1b92975b5eb575a9",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "inclusion": 0, "low": "9998" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_bool_field1",
"index_id": "21acda90edc9bfd7",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "true", "inclusion": 3, "low": "true" }
]
}
],
"using": "gsi"
}
]
},
{
"#operator": "IntersectScan",
"scans": [
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_varchar_field1",
"index_id": "34a6ef0683ca3cc7",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "cover ((`t_5`.`varchar_field1`))", "inclusion": 0, "low": "null" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_decimal_field1",
"index_id": "1b92975b5eb575a9",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "inclusion": 0, "low": "9998" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_bool_field1",
"index_id": "21acda90edc9bfd7",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "true", "inclusion": 3, "low": "true" }
]
}
],
"using": "gsi"
}
]
},
{
"#operator": "IntersectScan",
"scans": [
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_int_field1",
"index_id": "af0e6940ccd42871",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "inclusion": 0, "low": "cover ((`t_5`.`int_field1`))" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_decimal_field1",
"index_id": "1b92975b5eb575a9",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "inclusion": 0, "low": "9998" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_bool_field1",
"index_id": "21acda90edc9bfd7",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "true", "inclusion": 3, "low": "true" }
]
}
],
"using": "gsi"
}
]
},
{
"#operator": "IntersectScan",
"scans": [
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_int_field1",
"index_id": "af0e6940ccd42871",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "cover ((`t_5`.`int_field1`))", "inclusion": 0, "low": "null" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_bool_field1",
"index_id": "21acda90edc9bfd7",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "true", "inclusion": 3, "low": "true" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_decimal_field1",
"index_id": "1b92975b5eb575a9",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "inclusion": 0, "low": "9998" }
]
}
],
"using": "gsi"
}
]
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_varchar_field1",
"index_id": "34a6ef0683ca3cc7",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "inclusion": 0, "low": "cover ((`t_5`.`varchar_field1`))" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_varchar_field1",
"index_id": "34a6ef0683ca3cc7",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "cover ((`t_5`.`varchar_field1`))", "inclusion": 0, "low": "null" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_int_field1",
"index_id": "af0e6940ccd42871",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "inclusion": 0, "low": "cover ((`t_5`.`int_field1`))" }
]
}
],
"using": "gsi"
},
{
"#operator": "IndexScan2",
"ansi_join": true,
"as": "t_3",
"index": "simple_table_1_int_field1",
"index_id": "af0e6940ccd42871",
"index_projection":
{ "primary_key": true }
,
"keyspace": "multiple_table_db_8666_simple_table_1",
"namespace": "default",
"spans": [
{
"exact": true,
"range": [
{ "high": "cover ((`t_5`.`int_field1`))", "inclusion": 0, "low": "null" }
]
}
],
"using": "gsi"
}
]
},
{ "#operator": "Fetch", "ansi_join": true, "as": "t_3", "keyspace": "multiple_table_db_8666_simple_table_1", "namespace": "default" }
]
}
},
{ "#operator": "Filter", "condition": "(not ((((not ((`t_3`.`bool_field1`) = true)) or ((`t_3`.`decimal_field1`) between 7 and 9998)) and ((`t_1`.`bool_field1`) = true)) or (((\"bNscBvFIXt\" < cover ((`t_5`.`varchar_field1`))) or (\"549\" <= cover ((`t_5`.`primary_key_id`)))) and (not (`t_2`.`bool_field1`)))))" }
,
{
"#operator": "InitialProject",
"result_terms": [
{ "expr": "`t_2`", "star": true }
]
},
{ "#operator": "FinalProject" }
]
}
}
]
},
{ "#operator": "Limit", "expr": "100" }
]
},
"text": "SELECT t_2.* FROM multiple_table_db_8666_simple_table_4 t_2 LEFT JOIN multiple_table_db_8666_simple_table_2 t_1 ON ( (t_2.varchar_field1 <> t_1.varchar_field1 AND t_2.decimal_field1 = t_1.decimal_field1) ) LEFT JOIN multiple_table_db_8666_simple_table_3 t_5 ON ( t_2.primary_key_id = t_5.primary_key_id ) INNER JOIN multiple_table_db_8666_simple_table_1 t_3 ON ( NOT ((t_5.varchar_field1 = t_3.varchar_field1 AND t_5.int_field1 = t_3.int_field1)) ) WHERE NOT (((t_3.bool_field1 != true OR t_3.decimal_field1 BETWEEN 7 and 9998)) AND (t_1.bool_field1 = true) OR ((t_5.varchar_field1 > \"bNscBvFIXt\") OR (t_5.primary_key_id >= \"549\")) AND (NOT (t_2.bool_field1))) LIMIT 100"
}
Attachments
Issue Links
- duplicates
-
MB-27201 RQG query returns cause: write /tmp/scan-results2666872857286: file already closed
- Closed