spanner-interleave-subquery

command module
v0.0.0-...-0b3f5ac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

README

spanner-interleave-subquery

This example contains the benchmark code to examine query efficiency gains of using Cloud Spanner interleaved tables with subqueries.

Prerequisite

Run the following command to create a Cloud Spanner database with schema.sql.

gcloud spanner databases create ${DATABASE} --instance=${INSTANCE} --ddl-file=schema.sql

How to run the benchmark

Run the following command. You might need Go 1.15 or higher.

go run main.go --project=${PROJECT} --instance=${INSTANCE} --database=${DATABASE} --pattern=${PATTERN} --parallel=${PARALLEL}

For --pattern flag please specify the following number.

  1. Insert sample data.
  2. Run benchmark with separated queries for interleaved tables.
  3. Run benchmark with subqueries for interleaved tables.

You might need to run --pattern=1 prior to running the benchmark for --pattern=2 or --pattern=3 to insert sample data.

Note that this benchmark runs forever unless you stop the process by Ctr+C (SIGINT).

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL