# BigQuery: Exceeded rate limits — too many concurrent DML statements / table update operations

**Code:** `DML limits` · **Category:** Google Cloud / Firebase · **Seen on:** BigQuery, Google Cloud, SQL

Too many UPDATE/DELETE/MERGE statements (or table metadata updates) hit the same table at once.

## Meaning

BigQuery queues DML per table (up to 20 concurrent, with limits per day). Batch changes into fewer larger statements, use `MERGE`, load via temporary tables, prefer append-only designs with streaming/partition replace, and retry with backoff for `rateLimitExceeded`.

## Common causes

- Many small DML statements
- Concurrent writers to one table
- Row-by-row updates
- Table metadata updates too frequent
- Quota for table operations

## Quick fix

1. Batch into a single MERGE/INSERT SELECT
2. Serialise writers or use a queue
3. Retry with exponential backoff

## Detailed fix by platform

### SQL

1. `MERGE `proj.ds.target` T USING `proj.ds.staging` S ON T.id = S.id WHEN MATCHED THEN UPDATE SET v = S.v WHEN NOT MATCHED THEN INSERT (id, v) VALUES (S.id, S.v);`

## How to diagnose

1. **DML** — Many small?
2. **Writers** — Concurrent?
3. **Backoff** — Used?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/gcp/bigquery-exceeded-rate-limits-too-many-dml)
