                                                                QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------
 Hash Left Join  (cost=203.42..449.19 rows=5308 width=4)
   Hash Cond: (inventory_inventoryevent.cross_hire_id = inventory_crosshire.id)
   Filter: ((hashed SubPlan 1) OR (hashed SubPlan 2) OR (hashed SubPlan 3) OR (hashed SubPlan 4))
   ->  Hash Left Join  (cost=148.53..373.04 rows=5662 width=20)
         Hash Cond: (inventory_inventoryevent.purchase_id = inventory_purchase.id)
         ->  Hash Left Join  (cost=81.75..270.32 rows=5662 width=20)
               Hash Cond: (inventory_inventoryevent.booking_cross_hire_id = office_bookingcrosshire.id)
               ->  Hash Left Join  (cost=57.58..224.91 rows=5662 width=20)
                     Hash Cond: (inventory_inventoryevent.booking_stock_item_id = office_bookingstockitem.id)
                     ->  Seq Scan on inventory_inventoryevent  (cost=0.00..105.62 rows=5662 width=28)
                     ->  Hash  (cost=36.70..36.70 rows=1670 width=8)
                           ->  Seq Scan on office_bookingstockitem  (cost=0.00..36.70 rows=1670 width=8)
               ->  Hash  (cost=16.30..16.30 rows=630 width=8)
                     ->  Seq Scan on office_bookingcrosshire  (cost=0.00..16.30 rows=630 width=8)
         ->  Hash  (cost=40.79..40.79 rows=2079 width=8)
               ->  Seq Scan on inventory_purchase  (cost=0.00..40.79 rows=2079 width=8)
   ->  Hash  (cost=15.10..15.10 rows=510 width=8)
         ->  Seq Scan on inventory_crosshire  (cost=0.00..15.10 rows=510 width=8)
   SubPlan 1
     ->  Index Scan using inventory_stockitem_item_model_id on inventory_stockitem  (cost=0.28..8.35 rows=4 width=4)
           Index Cond: (item_model_id = 81)
   SubPlan 2
     ->  Index Scan using inventory_stockitem_item_model_id on inventory_stockitem inventory_stockitem_1  (cost=0.28..8.35 rows=4 width=4)
           Index Cond: (item_model_id = 81)
   SubPlan 3
     ->  Index Scan using inventory_stockitem_item_model_id on inventory_stockitem inventory_stockitem_2  (cost=0.28..8.35 rows=4 width=4)
           Index Cond: (item_model_id = 81)
   SubPlan 4
     ->  Index Scan using inventory_stockitem_item_model_id on inventory_stockitem inventory_stockitem_3  (cost=0.28..8.35 rows=4 width=4)
           Index Cond: (item_model_id = 81)