optimize posts sort