how can i see what sql is used

Check the logs in your log directory. You probably want development.log.