Hello,
This is the access info,
cbq> SELECT a FROM couchmusic2 AS a WHERE a.countryCode = ‘FI’ ;
{
“requestID”: “579c9ec7-1aa8-4c57-847b-bf329846c36a”,
“signature”: {
“a”: “json”
},
“results”: [
{
“a”: {
“countryCode”: “FI”,
“gdp”: 49547,
“name”: “Finland”,
“population”: 5462936,
“region-number”: 154,
“type”: “country”,
“updated”: “2015-09-06T18:00:05”
}
}
],
“status”: “success”,
“metrics”: {
“elapsedTime”: “38.207743933s”,
“executionTime”: “38.20768331s”,
“resultCount”: 1,
“resultSize”: 307
}
}
The elapsed time is more than 30 seconds.
And the explain plan:
cbq> explain SELECT a FROM couchmusic2 AS a WHERE a.countryCode = ‘FI’ ;
{
“requestID”: “39975487-a365-45b5-abe2-dca6f0a866e8”,
“signature”: “json”,
“results”: [
{
"#operator": “Sequence”,
"~children": [
{
"#operator": “PrimaryScan”,
“index”: “ndx_primary”,
“keyspace”: “couchmusic2”,
“namespace”: “default”,
“using”: “gsi”
},
{
"#operator": “Parallel”,
"~child": {
"#operator": “Sequence”,
"~children": [
{
"#operator": “Fetch”,
“as”: “a”,
“keyspace”: “couchmusic2”,
“namespace”: “default”
},
{
"#operator": “Filter”,
“condition”: “((a
.countryCode
) = “FI”)”
},
{
"#operator": “InitialProject”,
“result_terms”: [
{
“expr”: “a
”
}
]
},
{
"#operator": “FinalProject”
}
]
}
}
]
}
],
“status”: “success”,
“metrics”: {
“elapsedTime”: “1.570649ms”,
“executionTime”: “1.513094ms”,
“resultCount”: 1,
“resultSize”: 1517
}
}
cbq>
I’m a Couchbase dummy, because I come from Oracle database world.
What is indexed and how when I execute the :
CREATE PRIMARY INDEX NAME ON BUCKET;
Any doc or paper to understand couchbase indexing?
Many Thanks
Arturo