Skip to content
Visit booth 3171 at Google Cloud Next to see how to unlock real-time decisions at scaleMore info

Retrieve metadata details

This page describes Aerospike Quick Look (AQL) commands to list namespaces, sets, bins, and record details.

SHOW NAMESPACES

To list namespaces, enter the following command:

SHOW NAMESPACES
Example: List namespaces
show namespaces
+------------+
| namespaces |
+------------+
| "test" |
| "bar" |
+------------+
2 rows in set (0.001 secs)

SHOW SETS

To list sets, enter the following command:

SHOW SETS
Example: List sets
show sets
+---------+-----------+-----------+------------+-----------+---------+
| ns_name | set_name | n_objects | stop-write | evict-hwm | delete |
+---------+-----------+-----------+------------+-----------+---------+
| "test" | "newtest" | 11 | 0 | 0 | "false" |
| "test" | "users" | 1 | 0 | 0 | "false" |
+---------+-----------+-----------+------------+-----------+---------+
2 rows in set (0.001 secs)

SHOW BINS

To list bins, enter the following command:

SHOW BINS
Example: List bins
show bins
+-----------+-------+-------+-----------+
| namespace | count | quota | bin |
+-----------+-------+-------+-----------+
| "test" | 5 | 65535 | "b" |
| "test" | 5 | 65535 | "c" |
| "test" | 5 | 65535 | "a" |
| "test" | 5 | 65535 | "SUCCESS" |
| "test" | 5 | 65535 | "name" |
+-----------+-------+-------+-----------+
5 rows in set (0.000 secs)

EXPLAIN SELECT

To display details for a single record, enter the following command:

explain select * from <ns>.<set> where PK=<primary key value>
Example: List record details
explain select * from test.uqr where PK=1
[
{
"SET": "uqr",
"DIGEST": "42 7A 64 AE 7B 80 EE 02 3D B8 E9 00 8A F3 FF B0 7F DA EB 58",
"NAMESPACE": "test",
"PARTITION": 2626,
"STATUS": 2,
"UDF": "FALSE",
"KEY_TYPE": "STRING",
"TIMEOUT": 1000,
"NODE": "1771FE6C15290C00",
"POLICY": "AS_POLICY_REPLICA_MASTER",
"KEY_POLICY": "AS_POLICY_KEY_SEND"
}
]

The command contains the following arguments:

  • SET : Name of the set for the record.
  • DIGEST : Digest for the record.
  • NAMESPACE : Namespace for the record.
  • PARTITION : Partition where the record lives. The partition value is between 1 and 4095.
  • STATUS : Status of the operation. It is the status code returned by the client for the record. For example, 0 is AEROSPIKE_OK and 2 is AEROSPIKE_ERR_RECORD_NOT_FOUND. See the list of generic error codes in C - Error Codes.
  • KEY_TYPE : Type of the key (string/numeric etc) that was sent to the server.
  • TIMEOUT : Timeout value for the AQL command.
  • NODE : ID of the node where the master record currently lives. The node ID might change during migrations.
  • POLICY : Replica read policy that the client can set when reading the record. Two possible values are:
    • AS_POLICY_REPLICA_MASTER (which is by default) to set the reads to go only to its master copy and,
    • AS_POLICY_REPLICA_ANY to read in a round-robin operation on all its replica copies. Set the policy to AS_POLICY_REPLICA_ANY by executing set replica_any true in AQL.
  • KEY POLICY : Indicates whether the client sent the key and digest to the server or just the digest. Two possible values are:
    • AS_POLICY_KEY_SEND : If the key was sent along with the digest; and
    • AS_POLICY_KEY_DIGEST : If only the digest was sent.
Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?