googleapis / googleapis/google-cloud-php

Internal query iterator's batch size limit is undefined (Firestore Datastore)

Open
#7,852 1 comment 0 reactions 1 assignee Claimed by @Hectorhammett View on GitHub
Dominant language
PHP
Stars
1.2k
Forks
463
Avg merge
2d 1h
Merged PRs (30d)
145

Description

This library returns an iterator for queries. If no limit is specified, the iterator will continue until there are no results remaining e.g.
```
$datastore = new DatastoreClient();
$query = $datastore->query()
->kind('Task')
->filter('done', '=', false);

$iterator = $datastore->runQuery($query);
foreach ($iterator as $entity) {
...
}
```
What is the default value of limit if none is set? In other words, what is the max size of batches (pages) used by the internal iterator?

This is not documented in [limits](https://cloud.google.com/datastore/docs/reference/data/rest/v1/Query) or in the [Query](https://cloud.google.com/datastore/docs/reference/data/rest/v1/Query) reference.

Why this matters?
We need to know that the max value of `limit` so we can maximize throughput performance of batch processing of query results. There are some mentions of `setBatchSize()` in the Python library but this is not documented anywhere either. Additionally, we often need to batchInsert() n entities using results from the iterator and need to know the max size of each page.

Thank you

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.