| GroupAggregate (cost=114.32..115.76 rows=36 width=96) |
| Group Key: (GREATEST((CURRENT_DATE - date(eip.created_at)), 0)), prod.id |
| -> Sort (cost=114.32..114.41 rows=36 width=45) |
| Sort Key: (GREATEST((CURRENT_DATE - date(eip.created_at)), 0)), prod.id |
| -> Hash Join (cost=98.72..113.39 rows=36 width=45) |
| Hash Cond: (eip.product_id = prod.id) |
| -> Seq Scan on tbl_erp_inventory_products eip (cost=0.00..14.21 rows=36 width=25) |
| Filter: (((erp_purchase_inbound_id IS NOT NULL) OR (erp_purchase_gift_id IS NOT NULL) OR (erp_inventory_build_id IS NOT NULL) OR (erp_inventory_disassemble_id IS NOT NULL) OR (erp_inventory_start_id IS NOT NULL)) AND (inventory > '0'::numeric)) |
| -> Hash (cost=72.21..72.21 rows=2121 width=28) |
| -> Seq Scan on tbl_products prod (cost=0.00..72.21 rows=2121 width=28) |