Why is has_parent so slow? and can anything be done?