Understand how to model parent-child tables for best performance. Implement interleaved tables to co-locate related data rows.
- [Narrator] The next concept…in properly modeling for Spanner…is this idea of interleave,…or interleaving, multiple tables.…This is as important as a primary key.…So I'm gonna take a minute to clearly explain it.…First of all, foreign keys are not supported in Spanner.…Don't shoot the messenger.…I'm only reporting the news.…So how the heck do you optimize for joins?…Typically of course,…we put foreign keys and indexes on foreign keys,…and that causes the data to be duplicated…so the join is run efficiently.…
It's really a similar concept,…it's just kind of a different name.…So first of all, there are no foreign keys.…Secondly, if we are going to…have join queries running against related tables,…very typical in highly normalized relational databases,…so customers and their orders,…orders and the order details,…so on and so forth,…it's a parent child relationship between multiple tables.…Then when you model,…you indicate to Cloud Spanner…that you wanna physically colocate…the rows for efficient retrieval,…particularly joins using the interleave command…
Author
Released
6/7/2017- What is Cloud Spanner?
- Creating an instance and database using the console
- Making hot schema updates
- Cloud Spanner queries
- Loading data into Cloud Spanner
- Understanding transactions
- Cloud Spanner DevOps tools
- Auditing logs with Stackdriver
- Cost optimization
Skill Level Intermediate
Duration
Views
Related Courses
-
Google Cloud Storage and Data Essential Training
with Joseph Lowery2h 54m Intermediate -
SQL Tips, Tricks, & Techniques
with Ben Sullins59m 23s Intermediate -
Learning Relational Databases
with Adam Wilbert2h 43m Beginner -
Google Cloud Platform Essential Training
with Lynn Langit3h 56m Intermediate
-
Introduction
-
Welcome1m 12s
-
-
1. Why Cloud Spanner?
-
What is Cloud Spanner?2m 13s
-
When to use Cloud Spanner6m 53s
-
Cloud Spanner architecture1m 38s
-
-
2. Cloud Spanner Basics
-
Cloud Spanner objects2m 5s
-
Make hot schema updates2m 46s
-
Select best primary key2m 46s
-
Interleave tables4m 58s
-
-
3. Cloud Spanner Queries
-
Load data into Cloud Spanner4m 15s
-
Verify Python client setup4m 57s
-
Query data2m 43s
-
Add secondary index3m 50s
-
Read query execution plans1m 40s
-
Understand transactions1m 14s
-
-
4. Cloud Spanner DevOps
-
Audit logs with Stackdriver3m 35s
-
Instance configuration2m 19s
-
Cost optimization2m 4s
-
Conclusion
-
Next steps36s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Interleave tables