We need to understand the extent at which our customers are using or trying to use DDL and DML statements in a single transactions. For example this simple case is supported:
root@localhost:26257/system/defaultdb> CREATE TABLE t (a INT);
CREATE TABLE
Time: 48ms total (execution 48ms / network 0ms)
root@localhost:26257/system/defaultdb> BEGIN;
BEGIN
Time: 0ms total (execution 1ms / network 0ms)
root@localhost:26257/system/defaultdb OPEN> ALTER TABLE t ADD COLUMN b INT;
ALTER TABLE
Time: 16ms total (execution 16ms / network 0ms)
root@localhost:26257/system/defaultdb OPEN> INSERT INTO t (a) VALUES (1);
INSERT 0 1
Time: 4ms total (execution 4ms / network 0ms)
root@localhost:26257/system/defaultdb OPEN> COMMIt;
COMMIT
Time: 582ms total (execution 582ms / network 0ms)
root@localhost:26257/system/defaultdb> SELECT * FROM t;
a | b
----+-------
1 | NULL
(1 row)
Time: 1ms total (execution 0ms / network 0ms)
In such cases we should emit telemetry for a feature counter: sql.schema.ddl_dml_transaction_success
If there are cases where we emit a warning or do not support we should also log:
sql.schema.ddl_dml_transaction_failure
We should also measure DDL only transactions:
sql.schema.ddl_transaction_success
Similarly for failures
sql.schema.ddl_transaction_failure
Jira issue: CRDB-33841
Epic CRDB-31282
We need to understand the extent at which our customers are using or trying to use DDL and DML statements in a single transactions. For example this simple case is supported:
In such cases we should emit telemetry for a feature counter:
sql.schema.ddl_dml_transaction_successIf there are cases where we emit a warning or do not support we should also log:
sql.schema.ddl_dml_transaction_failureWe should also measure DDL only transactions:
sql.schema.ddl_transaction_successSimilarly for failures
sql.schema.ddl_transaction_failureJira issue: CRDB-33841
Epic CRDB-31282