Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update query stats samples #373

Merged
merged 2 commits into from Jun 22, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions samples/samples/snippets.py
Expand Up @@ -1703,7 +1703,10 @@ def query_data_with_query_options(instance_id, database_id):
with database.snapshot() as snapshot:
results = snapshot.execute_sql(
"SELECT VenueId, VenueName, LastUpdateTime FROM Venues",
query_options={"optimizer_version": "1"},
query_options={
"optimizer_version": "1",
"optimizer_statistics_package": "auto_20191128_14_47_22UTC"
larkee marked this conversation as resolved.
Show resolved Hide resolved
},
)

for row in results:
Expand All @@ -1716,7 +1719,11 @@ def create_client_with_query_options(instance_id, database_id):
# [START spanner_create_client_with_query_options]
# instance_id = "your-spanner-instance"
# database_id = "your-spanner-db-id"
spanner_client = spanner.Client(query_options={"optimizer_version": "1"})
spanner_client = spanner.Client(
query_options={
"optimizer_version": "1",
"optimizer_statistics_package": "latest"
})
instance = spanner_client.instance(instance_id)
database = instance.database(database_id)

Expand Down