Add & fix SQL tracing

- #3147
Totally agree, but not doing it as part of this change :smile: