Are these queries expensive? Is it better to use them in stored procedures.