Articles in this section

How to keep cache on your schema when querying via Trino

Context

When querying via the Trino connector, you would need to either define a schema or Aeorspike would do a PI query when (1) it is the first time you query that namespace and set or (2) it is the first time we query the namespace and set outside the aerospike.cache-ttl-ms window.

Method

To keep the schema cache for longer, you could adjust aerospike.cache-ttl-ms. The default value is 1,800,000ms (30 minutes), and the maximum is 9,223,372,036,854,775,807ms (~292 million years).


We don’t recommend setting the aerospike.cache-ttl-ms to a higher than necessary value, because it is tied to the session. For example, if you set aerospike.cache-ttl-ms to a year and your session expires in 24 hours, Aerospike would need to get the schema again in 24 hours when the session restarts. Another example why we don’t recommend setting aerospike.cache-ttl-ms to a higher value than necessary is that even if your session doesn’t expire for let’s say a year, if you add a new bin or new secondary index, ongoing queries would not be able to use that new information during the current aerospike.cache-ttl-ms window.

Please see our documentation on
Basic Configuration Properties for more details.

Applies To Earliest Version

4.9

Applies To Latest Version

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