adjust output format, enable select count, imporve sql query performance.