(why mark unread so slow?)
merged in helper_sql