Hi Wilson,
Let me go through each of these points in turn:
Can someone clarify what the STATUS value means when using the EXPLAIN feature? I have seen value of 0 and value of 2 returning in some of my runs. What do these values mean? are there any other values possible for it?
When explain runs, it executes a GET on the record in question. The STATUS value is the result of that get. So if I have a database with one record in, with a PK of 1 and explain that record, I will get:
aql> explain select * from test.testset where pk = 1
[
{
“SET”: “testset”,
“DIGEST”: “F5 91 24 98 6E 96 AD 17 5B 37 4C 94 87 94 5B BC AD 53 7B 74”,
“NAMESPACE”: “test”,
“PARTITION”: 501,
“STATUS”: 0,
“UDF”: “FALSE”,
“TIMEOUT”: 1000,
“NODE”: “BB9A9EAAB270008”,
“POLICY”: “AS_POLICY_REPLICA_MASTER”,
“KEY_POLICY”: “AS_POLICY_KEY_SEND”
}
]
The status of 0 is AEROSPIKE_OK. If I try to explain a record that doesn’t exist, I will get a status of 2 (AEROSPIKE_ERR_RECORD_NOT_FOUND):
aql> explain select * from test.testset where pk = 10
[
{
“SET”: “testset”,
“DIGEST”: “E0 CE E9 56 07 A3 F8 B2 CE 5E 87 70 70 7F 61 87 37 CD F6 2E”,
“NAMESPACE”: “test”,
“PARTITION”: 3808,
“STATUS”: 2,
“UDF”: “FALSE”,
“TIMEOUT”: 1000,
“NODE”: “BB9A9EAAB270008”,
“POLICY”: “AS_POLICY_REPLICA_MASTER”,
“KEY_POLICY”: “AS_POLICY_KEY_SEND”
}
]
A full set of statuses can be found in the client code (for example in the ResultCode class in the Java client).
Also, what are the other possible values of POLICY, under what conditions? From documentation it only shows “AS_POLICY_REPLICA_MASTER”.
This is the read policy. There are two possible values that explain prints today: AS_POLICY_REPLICA_MASTER and AS_POLICY_REPLICA_ANY. Default is AS_POLICY_REPLICA_MASTER. You can set aql to go do operation roundrobin on all the replica (in case it is read, write always goes to master) by doing:
aql> set replica_any true
aql> explain select * from test.testset where pk = 1
[
{
“SET”: “testset”,
“DIGEST”: “F5 91 24 98 6E 96 AD 17 5B 37 4C 94 87 94 5B BC AD 53 7B 74”,
“NAMESPACE”: “test”,
“PARTITION”: 501,
“STATUS”: 0,
“UDF”: “FALSE”,
“TIMEOUT”: 1000,
“NODE”: “BB9A9EAAB270008”,
“POLICY”: “AS_POLICY_REPLICA_ANY”,
“KEY_POLICY”: “AS_POLICY_KEY_SEND”
}
]
What are the possible values of KEY_POLICY? From documentation it only shows “AS_POLICY_KEY_SEND”
This is whether the key or the digest was sent. If sending the primary key, it shows AS_POLICY_KEY_SEND, if sending the digest it shows AS_POLICY_KEY_DIGEST:
aql> explain select * from test.testset where digest=‘F59124986E96AD175B374C9487945BBCAD537B74’
[
{
“SET”: “testset”,
“DIGEST”: “F5 91 24 98 6E 96 AD 17 5B 37 4C 94 87 94 5B BC AD 53 7B 74”,
“NAMESPACE”: “test”,
“PARTITION”: 501,
“STATUS”: 0,
“UDF”: “FALSE”,
“TIMEOUT”: 1000,
“NODE”: “BB9A9EAAB270008”,
“POLICY”: “AS_POLICY_REPLICA_ANY”,
“KEY_POLICY”: “AS_POLICY_KEY_DIGEST”
}
]
Hope this helps,
Tim