Ordering is slow, let's use counting
Ordering is slow, let's use counting

It's slow to order records when looking for the record we run into.
Instead, perform an unordered query to check for their existence and, if
there are some, then do the slow query.  In the majority of cases we
will never do the slower query.

sanger/warehouse_two,sanger/unified_warehouse,sanger/event_warehouse,sanger/event_warehouse,JamesGlover/unified_warehouse,JamesGlover/warehouse_two,sanger/barcode_warehouse,sanger/warehouse_two,sanger/unified_warehouse,emrojo/unified_warehouse,sanger/barcode_warehouse,emrojo/unified_warehouse,JamesGlover/warehouse_two,JamesGlover/event_warehouse,JamesGlover/event_warehouse,emrojo/unified_warehouse,JamesGlover/unified_warehouse,sanger/warehouse_two,sanger/barcode_warehouse,sanger/event_warehouse,JamesGlover/event_warehouse