Merge "Query for rowid column instead of * when we check row exists." into mainline-prod