FAQ - When does a query start returning records to the client?

FAQ - When does a query start returning records to the client?

Detail

An Aerospike query may take time to execute. At what point does it start to send records back to the client and at what point does the client release these to the application? Are the records aggregated together until a full result set is present before being presented to the application?

Answer

When an Aerospike client sends a secondary index query it is receieved by all nodes and the query will start to execute on those nodes. As the node starts to return results these results are sent back to the client which, in turn, passes them to the application. The application may well be receiving results while the query is still executing on the nodes within the cluster.

This does mean that if there is an issue while the query is still executing then an incomplete result set could be returned.

No aggregation is performed either on the node or the client.

Notes

  • Queries discussed here are queries with a ‘where’ clause (secondary index queries) as opposed to a simple key/value lookup which are referred to as a ‘get’.
  • Query results can be inconsistent during migration.
  • The query policy item failOnClusterChange checks for cluster stability before sending the query and at the end of the query and so it is possible that incomplete results could be returned during migrations.
  • If cluster stable returns false at the completion of the query when failOnClusterChange then an exception is passed to the application to indicate the result set may be incomplete.

Keywords

QUERY INCOMPLETE RESULTS WHEN RETURN FAILONCLUSTERCHANGE

Timestamp

July 2020

© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.