speed improvement by the use of db.executesql()