improve sql query performance.