make use of position_id to speed up psql queries