Skip to content

Commit

Permalink
chore(docs): update documentation to use the 80k mutation limit
Browse files Browse the repository at this point in the history
Fixes #1776
  • Loading branch information
olavloite committed Dec 6, 2024
1 parent 7d2baaa commit 80c583c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/copy.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can still copy data from/to a file by redirecting STDIN/STOUT to a file.
## COPY table_name FROM STDIN [BINARY]
`COPY table_name FROM STDIN [BINARY]` is supported. This feature can be used to insert bulk data to a Cloud
Spanner database. `COPY FROM STDIN` operations are atomic by default, but the standard transaction limits of
Cloud Spanner apply to these transactions. That means that at most 20,000 mutations can be included
Cloud Spanner apply to these transactions. That means that at most 80,000 mutations can be included
in one `COPY` operation. `COPY FROM STDIN` can also be executed in non-atomic mode by executing the statement
`SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'` before executing the copy operation.

Expand Down Expand Up @@ -36,7 +36,7 @@ create table numbers (number bigint not null primary key, name varchar);
cat numbers.txt | psql -h /tmp -d test-db -c "copy numbers from stdin;"
```

The above operation will fail if the `numbers.txt` file contains more than 20,000 mutations.
The above operation will fail if the `numbers.txt` file contains more than 80,000 mutations.

### Non-atomic COPY FROM STDIN example
```sql
Expand All @@ -48,7 +48,7 @@ cat numbers.txt | psql -h /tmp -d test-db -c "set spanner.autocommit_dml_mode='p
```

The above operation will automatically split the data over multiple transactions if the file
contains more than 20,000 mutations.
contains more than 80,000 mutations.

Note that this also means that if an error is encountered
during the `COPY` operation, some rows may already have been persisted to the database. This will
Expand Down

0 comments on commit 80c583c

Please sign in to comment.