Skip to content

Commit b51e7fd

Browse files
authored
chore(Spanner): Update batch_query_data sample (GoogleCloudPlatform#1853)
Update the `batch_query_data` sample to show the usage of `dataBoostEnabled` option for partition query
1 parent 0d8f29d commit b51e7fd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

spanner/src/batch_query_data.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ function batch_query_data(string $instanceId, string $databaseId): void
4242
$batch = $spanner->batch($instanceId, $databaseId);
4343
$snapshot = $batch->snapshot();
4444
$queryString = 'SELECT SingerId, FirstName, LastName FROM Singers';
45-
$partitions = $snapshot->partitionQuery($queryString);
45+
$partitions = $snapshot->partitionQuery($queryString, [
46+
// This is an optional parameter which can be used for partition
47+
// read and query to execute the request via spanner independent
48+
// compute resources.
49+
'dataBoostEnabled' => true
50+
]);
4651
$totalPartitions = count($partitions);
4752
$totalRecords = 0;
4853
foreach ($partitions as $partition) {

0 commit comments

Comments
 (0)