Using 4.1CE
My queries are slow and do not seem to use the GSI indexes what am I doing wrong.
CREATE INDEX idx_pId
ON development_bucket
(pId
);
CREATE INDEX idx_listing
ON development_bucket
(id
, pId
, s
);
EXPLAIN SELECT doc.id FROM development_bucket doc WHERE doc.id = “list-VyXX$ne3e” OR doc.pId = “list-VyXX$ne3e”;
[
{
“#operator”: “Sequence”,
“~children”: [
{
“#operator”: “PrimaryScan”,
“index”: “#primary”,
“keyspace”: “development_bucket”,
“namespace”: “default”,
“using”: “gsi”
},
{
“#operator”: “Parallel”,
“~child”: {
“#operator”: “Sequence”,
“~children”: [
{
“#operator”: “Fetch”,
“as”: “doc”,
“keyspace”: “development_bucket”,
“namespace”: “default”
},
{
“#operator”: “Filter”,
“condition”: “(((doc
.id
) = “list-VyXX$ne3e”) or ((doc
.pId
) = “list-VyXX$ne3e”))”
},
{
“#operator”: “InitialProject”,
“result_terms”: [
{
“expr”: “(doc
.id
)”
}
]
},
{
“#operator”: “FinalProject”
}
]
}
}
]
}
]