Create Iterator

The create iterator operation submits a query on a data grid table and creates an iterator object to present the query results.

Supply a filter string as an argument. This filter specifies the content of the query: that is, criteria for selecting a subset of rows from the table.

An iterator object receives batches of matching rows from the data grid. The prefetch property of the iterator determines the batch size.

The iterator consistency property allows the client to choose between the following snapshot consistency level:
  • global snapshot (default level)

    This level ensures that none of the results in the snapshot are from a partially committed transaction, although more coordination is required when taking the snapshot.

  • snapshot

    This level makes no guarantee about the results in the snapshot containing partially committed transactions but requires less coordination when taking the snapshot.

The iterator object presents the program with the individual rows that match the query, one at a time.

The program must close the iterator object to release resources within the data grid component processes. For more information, see Query Behavior.

An implicit timeout limits the lifespan of iterator objects. Program calls that access an iterator after that timeout elapses return an error.

Avoid queries that result in full table scans, which can be resource-intensive and time-consuming. For more information, see Efficiency of Filters.

Related concepts