table-persistence-before-large-transaction.td 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. #
  10. # Tests for wide and long transactions
  11. #
  12. > CREATE TABLE wide_transaction (f1 TEXT);
  13. > INSERT INTO wide_transaction VALUES (REPEAT('x', 100 * 1024 * 1024));
  14. > CREATE TABLE long_ten (f1 INTEGER);
  15. > INSERT INTO long_ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
  16. > CREATE TABLE long_transaction (f1 INTEGER);
  17. # Insert 1M unique rows
  18. > SET statement_timeout = '120s'
  19. > INSERT INTO long_transaction
  20. SELECT (a1.f1 * 1) +
  21. (a2.f1 * 10) +
  22. (a3.f1 * 100) +
  23. (a4.f1 * 1000) +
  24. (a5.f1 * 10000) +
  25. (a6.f1 * 100000)
  26. FROM long_ten AS a1, long_ten AS a2, long_ten AS a3, long_ten AS a4, long_ten AS a5, long_ten AS a6;