Aggregate (cost=268.03..268.04 rows=1 width=8) |
-> Sort (cost=264.16..264.81 rows=258 width=293) |
Sort Key: pci.from_date DESC NULLS LAST, pci.created_at DESC |
-> HashAggregate (cost=251.25..253.83 rows=258 width=293) |
Group Key: pci.id |
-> Hash Right Join (cost=186.49..250.60 rows=258 width=16) |
Hash Cond: (pcpp.purchase_invoice_id = pci.id) |
-> Seq Scan on tbl_purchase_invoice_products pcpp (cost=0.00..54.85 rows=1885 width=4) |
-> Hash (cost=183.27..183.27 rows=258 width=16) |
-> Hash Right Join (cost=143.16..183.27 rows=258 width=16) |
Hash Cond: (pip.purchase_invoice_id = pci.id) |
-> Seq Scan on tbl_purchase_invoice_projects pip (cost=0.00..30.52 rows=1952 width=8) |
-> Hash (cost=139.93..139.93 rows=258 width=16) |
-> Hash Join (cost=77.88..139.93 rows=258 width=16) |
Hash Cond: (ip.purchase_invoice_id = pci.id) |
-> Seq Scan on tbl_inventory_products ip (cost=0.00..61.38 rows=258 width=4) |
Filter: (inventory > '0'::numeric) |
-> Hash (cost=50.17..50.17 rows=2217 width=24) |
-> Seq Scan on tbl_purchase_contract_invoices pci (cost=0.00..50.17 rows=2217 width=24) |
Filter: (cover_invoice_id IS NULL) |