We are using cb4 community edition and we are experiencing very slow responses. CB is the only thing on the server, we are using 1 node for indexing and storage since we are still in development mode.
Our issue is the following:
We have a bucket with 22000 items
We have a GSI index on it that looks like this
"indexes": {
“datastore_id”: “http://127.0.0.1:8091”,
“id”: “a1a3d6a0fd8add4d”,
“index_key”: [
"type
",
"code
"
],
“keyspace_id”: “zipt”,
“name”: “rate_code_index3”,
“namespace_id”: “default”,
“state”: “online”,
“using”: “gsi”
}
So basically a GSI index on type and rate. There is 21000 documents that would match this query in the bucket.
The query
SELECT * FROM zipt
USE INDEX(rate_code_index3 USING GSI) WHERE (type
= “rate” and code
=577613) limit 1;
is currently executing in a whooping 3.5s which I think i very slow.
This is the explain of the query
{
“requestID”: “14be6a46-e9e9-48da-8f1f-24fb697ab31e”,
“signature”: “json”,
“results”: [
{
"#operator": “Sequence”,
"~children": [
{
"#operator": “Sequence”,
"~children": [
{
"#operator": “IndexScan”,
“index”: “rate_code_index3”,
“keyspace”: “zipt”,
“limit”: 9.223372036854776e+18,
“namespace”: “default”,
“spans”: [
{
“Range”: {
“High”: [
"“rate\u0009"”
],
“Inclusion”: 1,
“Low”: [
"“rate”"
]
},
“Seek”: null
}
],
“using”: “gsi”
},
{
"#operator": “Parallel”,
"~child": {
"#operator": “Sequence”,
"~children": [
{
"#operator": “Fetch”,
“keyspace”: “zipt”,
“namespace”: “default”
},
{
"#operator": “Filter”,
“condition”: “(((zipt
.type
) = “rate”) and ((zipt
.code
) = 577613))”
},
{
"#operator": “InitialProject”,
“result_terms”: [
{
“star”: true
}
]
},
{
"#operator": “FinalProject”
}
]
}
}
]
},
{
"#operator": “Limit”,
“expr”: “1”
}
]
}
],
“status”: “success”,
“metrics”: {
“elapsedTime”: “10.385487ms”,
“executionTime”: “10.164681ms”,
“resultCount”: 1,
“resultSize”: 2712
}
}
Are we doing anything wrong?
The bucket also has a primary index
Is it supposed to be this slow? This is kind of unusable in this form so if you could help in any way it would be much appreciated!
Thank you