Added by dalley over 1 year ago
Dramatically increase re-sync performance
Increase the performance of the QueryExisting* stages. pulp_created=None was originally picked because it wouldn't match with anything, and an empty Q() object matches with everything. But it's a lookup on an unindexed field that requires looking at an entirely different table, so it ends up being incredibly inefficient. It turns out that there is a way to accomplish the same thing that gets compiled out of the query entirely.