Big data sql performance optimization paging algorithm