Fixes missing delete-event triggers for matrialized views.
Logs SQL for Ctree discovery.