Revert "Optimization SQL"

This reverts commit 618ea0a233d89cbb3a471eec9e9742880831580d.