Questions tagged [google-cloud-spanner]

Google Cloud Spanner is a relational, highly scalable, managed, database service. Cloud Spanner solves the need for a horizontally-scaling database with consistent global ACID transactions and SQL semantics

Google Cloud Spanner is the first and only relational database service that is both strongly consistent and horizontally scalable. Features include:

  • ACID transactions,
  • Relational schemas (and schema changes without downtime),
  • SQL queries, high performance,
  • Automatic scaling for horizontal scalability to hundreds or thousands of servers
  • Synchronous data replication, and node redundancy
  • Up to 99.999% (five 9s) of availability
  • Based upon the published Spanner research paper

Stack Overflow is Google's official community support channel for development questions.

Please include the appropriate client library language tag (, , , or ) with your question. You can also include the platform tag (, , or ).

647 questions
3
votes
2 answers

Is there any way I an delete more than 20k mutation in Google Cloud Spanner?

I have millions of records in Spanner table and I would like to delete rows from Spanner using some query condition. For Eg: delete from spanner table where id > 2000. I'm not able to run this query in Spanner UI, because of Spanner 20k mutation…
3
votes
2 answers

com.google.cloud.spanner.SpannerException: DEADLINE_EXCEEDED

i've been stuck with this issue for over a day and thought someone here might know the answer. Basically, as a simple test i'm trying to read data from a table and simply output the results to a log file. The table is rather large (~167 million…
3
votes
1 answer

Does INTERLEAVE support the transitive property?

Lets say I have three tables, Foo, Bar and Baz CREATE TABLE Foo ( FooId BYTES(MAX) ) PRIMARY KEY (FooId); CREATE TABLE Bar ( FooId BYTES(MAX), BarId BYTES(MAX) ) PRIMARY KEY (FooId, BarId), INTERLEAVE IN PARENT Foo on DELETE CASCADE; CREATE TABLE…
Greg Hilston
  • 2,397
  • 2
  • 24
  • 35
3
votes
1 answer

How can one interleave with two tables?

Let's pretend I have the schema CREATE TABLE Account ( AccountId BYTES(MAX), Foo STRING(1024) ) PRIMARY KEY (AccountId);" CREATE TABLE Customer ( CustomerId BYTES(MAX), Bar STRING(1024) ) PRIMARY KEY (CustomerId);" And I create a new…
Greg Hilston
  • 2,397
  • 2
  • 24
  • 35
3
votes
2 answers

How to query unique or distinct values from joining 3 tables which have one to many relationships

I wanted to get distinct country values for each category. Say for example. A Category has many companies which in turn has many sub-compoanies under it that belong to different counties. Let's say a Cars Category and its companies are Toyota and…
Gashio Lee
  • 119
  • 1
  • 15
3
votes
2 answers

Why Spanner performs full table scan using a underscore in a LIKE, while using % leverages the index?

In a query, if I use LIKE '%' on the primary key it performs well, using the index: Operator | Rows returned | Executions | Latency -- | -- | -- | -- Serialize Result 32 1 1.80 ms Sort 32 1 1.78 ms Hash Aggregate 32 1 1.73 ms …
juanignaciosl
  • 3,435
  • 2
  • 28
  • 28
3
votes
2 answers

How is "after" and "before" method implemented in Google Spanner truetime?

According to their pager, it says "The TT.after() and TT.before() methods are convenience wrappers around TT.now()." And according to What is the TrueTime API in Google's Spanner? It also provides two functions: after(t) returns true if t has…
Tim
  • 475
  • 3
  • 15
3
votes
2 answers

GCP: Can we modify primary key of an existing table in spanner

I want to modify Primary key of an existing Table in Spanner from Col1 to combination of Col1 and Col2. Is it possible to do it in Spanner? This option is not available in Console. Maybe it can be done with a script!
Ayush
  • 121
  • 1
  • 13
3
votes
1 answer

Create trigger based on insertion/updation in spanner database

I want to run a nodejs Job whenever an entry is created on the spanner database. The entry in spanner database will contain some future timestamp. The nodejs Job should run at that particular timestamp. Can I apply some db trigger to initiate the…
Ankur Verma
  • 75
  • 1
  • 12
3
votes
1 answer

How can you efficiently create a strong ordered sequence in Spanner?

Google Spanner recommends against using things like timestamps or sequential numbers as the initial part of a primary key or index, which makes sense based on the architecture. However, for my requirements, I do need some way of ensuring a strict…
SoftMemes
  • 5,602
  • 4
  • 32
  • 61
3
votes
6 answers

How to export Google spanner query results to .csv or google sheets?

I am new to google spanner and I have run a query and found about 50k rows of data. I want to export that resultset to my local machine like .csv or into a google sheet. Previously I have used TOAD where I have an export button, but here I do not…
3
votes
1 answer

Export / Import tool with Google Spanner

I have several questions regarding the Google Spanner Export / Import tool. Apparently the tool creates a dataflow job. Can an import/export dataflow job be re-run after it had run successfully from the tool? If so, will it use the current…
Dave
  • 123
  • 2
  • 13
3
votes
1 answer

Cloud spanner and doctrine 2.x

Is there already an implementation for doctrine2 with cloud spanner? Or can this be achieved with the PDOMySQL driver class?
3
votes
1 answer

Cloud Spanner: Unexpected CPU utilization

We are running a small part of our production data in Google Cloud Spanner since 8months for testing and learning things about Cloud Spanner. Rough characteristics: 1 table, 4 billion rows, around 600GB storage size, 25mio lines added per day,…
3
votes
2 answers

Trying to add Support For Index Usage on EFCore Spanner Provider

I'm writing a driver for EF Core for Spanner - In basic level it works and I can write Read and Write Queries that get's translated to Spanner SQL , executed and return results etc.. Now I'm trying to add Support For Read Query with Secondary…
Al Yaros
  • 151
  • 3