add precompile
revised sql