Prev Next

Database / Google Spanner Database Interview questions

What is the difference between batch DML and partitioned DML?

Batch DMLPartitioned DML
Groups several DML statements into one transaction.Splits one large DML statement across many transactions internally.
Fully atomic - all statements commit or none do.Not atomic as a whole - executes as independent sub-ranges.
Bound by normal transaction size and lock limits.Designed for bulk updates/deletes across millions of rows.

Batch DML is the right tool when you have several related, moderate-size statements that must succeed or fail together, like updating a handful of related tables in one logical change. Partitioned DML is built for maintenance-style operations, such as deleting rows older than a retention window across an entire large table, where wrapping the whole thing in a single transaction would exceed transaction limits or hold locks far too long.

Which DML mode is fully atomic across all its statements?
Which is designed for bulk deletes across millions of rows?

Invest now in Acorns!!! 🚀 Join Acorns and get your $5 bonus!
Acorns Logo

Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!

Earn passively and while sleeping

Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.

Robinhood Logo

Invest now!!! Get Free equity stock (US, UK only)!

Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.

The Robinhood app makes it easy to trade stocks, crypto and more.


Webull Logo

Webull! Receive free stock by signing up using the link: Webull signup.

More Related questions...

What is Google Cloud Spanner? What are the main features of Google Spanner? What is the purpose of TrueTime in Spanner? Define interleaved tables in Google Spanner? What is a Spanner instance? What are processing units in Google Spanner? Describe primary keys in Google Spanner schema design? What are the supported database dialects in Spanner? List the data types supported by Google Spanner? How do you create a database in Google Spanner? What is a secondary index in Spanner? Explain the purpose of splits in Spanner? What are mutations in Google Spanner? How do you apply schema changes in Spanner? What is the Spanner emulator? Why does Spanner use TrueTime for consistency? How does Spanner achieve external consistency? What is the difference between read-write and read-only transactions in Spanner? When should you use interleaved tables versus foreign keys? What happens when a hotspot occurs in Spanner? How is data partitioned across nodes in Spanner? Why should you avoid monotonically increasing primary keys? What is the difference between Spanner and Cloud SQL? How does Spanner handle schema changes without downtime? When would you choose bounded staleness over strong reads? How can you optimize query performance in Spanner? What is the difference between Data Boost and standard reads? Why do we use commit timestamps in Spanner tables? How does Spanner's query optimizer choose an execution plan? What is the difference between batch DML and partitioned DML? When should you use change streams in Spanner? How is fine-grained access control implemented in Spanner? Why doesn't Spanner support auto-incrementing primary keys? What is the difference between GoogleSQL and PostgreSQL dialects in Spanner? How do you troubleshoot high latency in Spanner queries? Explain the internal working of Paxos in Spanner replication? Explain the execution flow of a read-write transaction in Spanner? Explain the lifecycle of a split in Spanner? How does Spanner guarantee external consistency across regions? What happens internally when Spanner commits a distributed transaction? How can you optimize a multi-region Spanner configuration for latency? Which is better and why: multi-region or regional Spanner configuration for a global app? How does directed reads improve read latency in multi-region Spanner? Why is clock skew uncertainty critical to Spanner's TrueTime API? How do you troubleshoot transaction aborts in Spanner? Explain the internal working of the Spanner query execution engine? What happens when a leader region becomes unavailable in Spanner? How does Spanner implement point-in-time recovery internally? Explain the execution flow of a partitioned DML statement in Spanner? How can you optimize schema design to avoid hotspotting at scale?
Show more question and Answers...

Integration

Comments & Discussions