Add some more logging for SQL queries

Change-Id: I4b251a41b7db32011a0793eb0dba2dd4b4658b59