Articles in this section

FAQ - PI queries when querying by key via Trino

Detail

  1. Why do we see PI-queries (scans) when querying by key via Trino? Shouldn’t this only invoke a batch? For example: SELECT * FROM namespace.set WHERE __key=<key>
  2. When do these PI-queries happen?

Answer

  1. Aerospike needs to get the schema when querying via Trino. If you didn’t specify a schema, Aerospike will do a PI-query on some of the records within the namespace.set you are querying to get the schema. If this is the first time you are querying that namespace/set or if it’s the first time querying that namespace/set outside of the aerospike.cache-ttl-ms window, Aerospike will need to get the schema through a PI-query. When Aerospike needs to get the schema, you would see a PI-query getting triggered and a batch.
  2. These PI-queries only happen when:
    1. It is the first time the namespace/set is getting queried
    2. It is the first time the namespace/set is getting queried outside the aerospike.cache-ttl-ms window
    3. Also note that we would need to get the schema for every session. If the session has expired, we would also need to get the schema again. If you use a different user, that user would also need to get the schema.

Applies To Earliest Version

4.9

Applies To Latest Version

Current Version
Was this article helpful?
0 out of 0 found this helpful