Added old smaller sql for debugging