Impact of TRUNCATE TABLE?

575 views
Skip to first unread message

cto...@gmail.com

unread,
Jul 17, 2020, 9:01:24 PM7/17/20
to debezium
Hi, does TRUNCATE TABLE cause problems for a table being processed by Debezium? We're using the transactional outbox pattern and have a bunch of rows in the outbox table from bootstrapping the data set, and given how long it will likely take to DELETE them all, we're wondering if TRUNCATE TABLE is an option instead.

We're using the MySQL connector w/ Debezium 1.0.

thx,
Chris

Gunnar Morling

unread,
Jul 18, 2020, 5:00:28 AM7/18/20
to debezium
Hey Chris,

So the problem with TRUNCATE is that Debezium won't be able to emit DELETE events for the individual records. But coincidentally, for your particular use case, the outbox pattern, this shouldn't matter as the outbox table conceptually is like an append-only log and deletes (nor update) never should be propagated to begin with (the outbox event router ignores those events). I.e. TRUNCATE of the outbox table should be no problem at all.

--Gunnar

Chris Toomey

unread,
Jul 18, 2020, 2:47:20 PM7/18/20
to debe...@googlegroups.com
Thanks Gunnar. I was concerned that since it results in DROP TABLE, CREATE TABLE commands, that this might cause confusion on behalf of Debezium, so that it might re-initiate a snapshot or something. So you can confirm that that doesn't happen, that it's effectively invisible and Debezium would pick right up with the next INSERT as if nothing had happened?

thanks,
Chris


--
You received this message because you are subscribed to a topic in the Google Groups "debezium" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/debezium/HIOWLM56rlo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to debezium+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/debezium/3351d549-1948-4f03-b925-775eb4ce342fn%40googlegroups.com.

Jiri Pechanec

unread,
Jul 20, 2020, 12:00:13 AM7/20/20
to debezium
Hi,

you are correct. Debezium does not take any action.

J.
To unsubscribe from this group and all its topics, send an email to debe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages