explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7qkB

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Subquery Scan on idl (cost=20,989,540.59..22,308,949.73 rows=17,024,634 width=1,274) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

WindowAgg (cost=20,989,540.59..21,287,471.69 rows=17,024,634 width=194) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=20,989,540.59..21,032,102.18 rows=17,024,634 width=194) (actual rows= loops=)

  • Sort Key: id.invoiceid
4. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=13,101,876.76..17,315,473.67 rows=17,024,634 width=194) (actual rows= loops=)

  • Group Key: id.invdocid, id.invdocref, id.invoiceid, id.amount, id.vatamount, id.totalamount, id.invoicedate, id.duedate, cu.customernbr, c.supplierref, i.rundate, i.periodstart, i.periodend, i.billingrunid, pv.valuecode, i.final, i.cancellation, i.rectification, ic.invoiceid, ic.consumptionid
5. 0.000 0.000 ↓ 0.0

Sort (cost=13,101,876.76..13,144,438.34 rows=17,024,634 width=194) (actual rows= loops=)

  • Sort Key: id.invdocid, id.invdocref, id.invoiceid, id.amount, id.vatamount, id.totalamount, id.invoicedate, id.duedate, cu.customernbr, c.supplierref, i.rundate, i.periodstart, i.periodend, i.billingrunid, pv.valuecode, i.final, i.cancellation, i.rectification, ic.invoiceid, ic.consumptionid
6. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=7,599,637.28..9,427,809.84 rows=17,024,634 width=194) (actual rows= loops=)

  • Hash Cond: (ir.finalinvoiceid = idr.invoiceid)
7. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=7,530,992.92..8,051,566.42 rows=17,024,634 width=186) (actual rows= loops=)

  • Hash Cond: (ic.invoiceid = i.invoiceid)
8. 0.000 0.000 ↓ 0.0

Seq Scan on invoicedconsumption ic (cost=0.00..26,622.60 rows=969,360 width=8) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Hash (cost=6,885,917.99..6,885,917.99 rows=17,024,634 width=182) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Hash Join (cost=417,362.71..6,885,917.99 rows=17,024,634 width=182) (actual rows= loops=)

  • Hash Cond: (idl_1.invdocid = id.invdocid)
11. 0.000 0.000 ↓ 0.0

Seq Scan on invdocline idl_1 (cost=0.00..5,824,024.71 rows=13,989,177 width=72) (actual rows= loops=)

  • Filter: (((detail)::text = ANY ('{customer.category,customer.individual,customer.dataStatus,customer.title,customer.firstName,customer.name,customer.companyName,customer.legalForm,customer.tvaApplication,customer.vatNumber,customer.address,customer.languageCode,customer.mail,contract.marketCode,contract.productCode,contract.categoryCode,contract.deliveryCategory,contract.duration,contract.invoiceDeliveryMode,contract.paymentMode,contract.domiciliationDescription,contract.bankAccountDescription,external.newInstalmentAmount,invoicee.individual,invoicee.title,invoicee.firstName,invoicee.name,invoicee.companyName,invoicee.legalForm,invoicee.languageCode,invoicee.email}'::text[])) OR ((resultset)::text = 'invoice.vcs'::text))
12. 0.000 0.000 ↓ 0.0

Hash (cost=376,284.53..376,284.53 rows=1,365,694 width=114) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=271,450.63..376,284.53 rows=1,365,694 width=114) (actual rows= loops=)

  • Hash Cond: (ir.originalinvoiceid = i.invoiceid)
14. 0.000 0.000 ↓ 0.0

Seq Scan on invoicerelation ir (cost=0.00..41,047.69 rows=1,732,169 width=20) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash (cost=241,142.56..241,142.56 rows=1,077,606 width=98) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Hash Join (cost=104,815.74..241,142.56 rows=1,077,606 width=98) (actual rows= loops=)

  • Hash Cond: (i.invoicenatureparamid = pv.parametervalueid)
17. 0.000 0.000 ↓ 0.0

Hash Join (cost=104,762.96..226,272.70 rows=1,077,606 width=89) (actual rows= loops=)

  • Hash Cond: (i.contractid = c.contractid)
18. 0.000 0.000 ↓ 0.0

Hash Join (cost=94,927.95..193,538.56 rows=1,077,606 width=76) (actual rows= loops=)

  • Hash Cond: (i.invoiceid = id.invoiceid)
19. 0.000 0.000 ↓ 0.0

Seq Scan on invoice i (cost=0.00..49,423.74 rows=1,366,774 width=31) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Hash (cost=71,985.88..71,985.88 rows=1,077,606 width=45) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash Join (cost=850.94..71,985.88 rows=1,077,606 width=45) (actual rows= loops=)

  • Hash Cond: (id.invdocrunid = br.billingrunid)
22. 0.000 0.000 ↓ 0.0

Seq Scan on invdoc id (cost=0.00..49,136.94 rows=1,122,194 width=49) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Hash (cost=689.31..689.31 rows=12,930 width=4) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Seq Scan on billingrun br (cost=0.00..689.31 rows=12,930 width=4) (actual rows= loops=)

  • Filter: ((accountingstate)::text = 'terminated'::text)
25. 0.000 0.000 ↓ 0.0

Hash (cost=8,325.02..8,325.02 rows=120,799 width=21) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Hash Join (cost=2,495.05..8,325.02 rows=120,799 width=21) (actual rows= loops=)

  • Hash Cond: (c.customerid = cu.customerid)
27. 0.000 0.000 ↓ 0.0

Seq Scan on contract c (cost=0.00..3,413.99 rows=120,799 width=19) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Hash (cost=1,880.58..1,880.58 rows=49,158 width=10) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Seq Scan on customer cu (cost=0.00..1,880.58 rows=49,158 width=10) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Hash (cost=41.79..41.79 rows=879 width=17) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Seq Scan on parametervalue pv (cost=0.00..41.79 rows=879 width=17) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Hash (cost=49,136.94..49,136.94 rows=1,122,194 width=16) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Seq Scan on invdoc idr (cost=0.00..49,136.94 rows=1,122,194 width=16) (actual rows= loops=)