Internal query iterator's batch size limit is undefined (Firestore Datastore)
@Hectorhammett is already working on this.
Since Nov 17, 2025.
Assessment
This issue has not been assessed yet.
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 or in the 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
- Dominant language
- PHP
- Stars
- 1.2k
- Forks
- 464
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 103
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from googleapis/google-cloud-php
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
googleapis/google-cloud-php#9730 ·
-
type: feature request
Difficulty 1/5 Under an hour Newbie friendliness 75/100
googleapis/google-cloud-php#9716 · 11 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
googleapis/google-cloud-php#9725 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
googleapis/google-cloud-php#9675 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
googleapis/google-cloud-php#9674 · 1 comment ·
All issues in googleapis/google-cloud-php
Similar issues
-
tooling
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
UX
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ProfessionalWiki/NeoWiki#1525 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
OpenConext/OpenConext-engineblock#2122 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Automattic/safe-publish#594 ·