explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gMPt

Settings
# exclusive inclusive rows x rows loops node
1. 2.406 256.972 ↓ 962.0 962 1

Nested Loop Left Join (cost=15,625.05..16,349.49 rows=1 width=1,810) (actual time=201.288..256.972 rows=962 loops=1)

2. 1.333 253.604 ↓ 962.0 962 1

Nested Loop Left Join (cost=15,624.92..16,341.16 rows=1 width=1,655) (actual time=201.261..253.604 rows=962 loops=1)

3. 1.481 252.271 ↓ 962.0 962 1

Nested Loop Left Join (cost=15,624.78..16,340.99 rows=1 width=611) (actual time=201.251..252.271 rows=962 loops=1)

4. 1.085 249.828 ↓ 962.0 962 1

Nested Loop Left Join (cost=15,624.51..16,340.69 rows=1 width=597) (actual time=201.240..249.828 rows=962 loops=1)

5. 1.090 246.819 ↓ 962.0 962 1

Nested Loop Left Join (cost=15,624.08..16,340.20 rows=1 width=597) (actual time=201.228..246.819 rows=962 loops=1)

6. 1.448 244.767 ↓ 962.0 962 1

Nested Loop Left Join (cost=15,623.94..16,340.04 rows=1 width=601) (actual time=201.218..244.767 rows=962 loops=1)

7. 1.481 242.357 ↓ 962.0 962 1

Nested Loop Left Join (cost=15,623.67..16,339.75 rows=1 width=591) (actual time=201.207..242.357 rows=962 loops=1)

8. 1.076 239.914 ↓ 962.0 962 1

Nested Loop Left Join (cost=15,623.39..16,333.44 rows=1 width=581) (actual time=201.198..239.914 rows=962 loops=1)

9. 0.924 236.914 ↓ 962.0 962 1

Nested Loop Left Join (cost=15,622.97..16,332.98 rows=1 width=465) (actual time=201.183..236.914 rows=962 loops=1)

10. 0.000 231.180 ↓ 962.0 962 1

Nested Loop Left Join (cost=15,622.55..16,332.51 rows=1 width=457) (actual time=201.173..231.180 rows=962 loops=1)

  • Join Filter: (ps_apfeps.apfda_id = ps_apfeps_t_apfda.id)
  • Rows Removed by Join Filter: 19,189
11. 11.886 210.349 ↓ 962.0 962 1

Gather (cost=15,620.49..16,329.32 rows=1 width=447) (actual time=201.092..210.349 rows=962 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
12. 1.815 198.463 ↓ 192.0 192 5 / 5

Parallel Hash Left Join (cost=14,620.49..15,329.22 rows=1 width=447) (actual time=196.170..198.463 rows=192 loops=5)

  • Hash Cond: (ps_eps.id = ps_apfeps.id)
  • Filter: ((ps_apfeps.id = fi_ps_apfeps.id) OR (ps_apfeps.id IS NULL))
13. 0.335 5.578 ↑ 248.7 192 5 / 5

Merge Join (cost=1,531.96..2,115.36 rows=47,746 width=439) (actual time=3.799..5.578 rows=192 loops=5)

  • Merge Cond: (si.nettingbundle_id = nb.id)
14. 0.508 2.840 ↑ 3,122.5 526 5 / 5

Nested Loop Left Join (cost=0.86..1,786,202.47 rows=1,642,460 width=371) (actual time=1.039..2.840 rows=526 loops=5)

15. 1.280 1.280 ↑ 3,122.5 526 5 / 5

Parallel Index Scan using supplierinvoice_nettingbundle_idx on supplierinvoice si (cost=0.43..784,438.39 rows=1,642,460 width=191) (actual time=1.018..1.280 rows=526 loops=5)

16. 1.052 1.052 ↓ 0.0 0 2,629 / 5

Index Scan using earlypaymentsettlement_invoice_idx on earlypaymentsettlement ps_eps (cost=0.43..0.61 rows=1 width=196) (actual time=0.002..0.002 rows=0 loops=2,629)

  • Index Cond: (si.id = invoice_id)
17. 0.124 2.403 ↓ 43.0 215 5 / 5

Sort (cost=1,531.10..1,531.11 rows=5 width=76) (actual time=2.344..2.403 rows=215 loops=5)

  • Sort Key: nb.id
  • Sort Method: quicksort Memory: 32kB
  • Worker 0: Sort Method: quicksort Memory: 32kB
  • Worker 1: Sort Method: quicksort Memory: 32kB
  • Worker 2: Sort Method: quicksort Memory: 32kB
  • Worker 3: Sort Method: quicksort Memory: 32kB
18. 0.166 2.279 ↓ 10.2 51 5 / 5

Nested Loop Left Join (cost=1.29..1,531.04 rows=5 width=76) (actual time=0.131..2.279 rows=51 loops=5)

  • Join Filter: (fi_si.originatordivision_id = od_db.id)
  • Rows Removed by Join Filter: 322
19. 0.055 2.011 ↓ 10.2 51 5 / 5

Nested Loop (cost=1.29..1,528.81 rows=5 width=64) (actual time=0.118..2.011 rows=51 loops=5)

20. 0.393 1.803 ↓ 10.2 51 5 / 5

Nested Loop (cost=0.86..1,525.61 rows=5 width=64) (actual time=0.101..1.803 rows=51 loops=5)

  • Join Filter: (fi_ps_apfeps.apfda_id = fi_ps_apfeps_t_apfda.id)
  • Rows Removed by Join Filter: 691
21. 0.211 1.238 ↓ 9.1 172 5 / 5

Nested Loop (cost=0.86..1,522.97 rows=19 width=72) (actual time=0.035..1.238 rows=172 loops=5)

22. 0.274 0.683 ↓ 1.2 172 5 / 5

Nested Loop (cost=0.43..1,457.55 rows=146 width=56) (actual time=0.023..0.683 rows=172 loops=5)

23. 0.065 0.065 ↑ 1.0 172 5 / 5

Seq Scan on nettingbundle nb (cost=0.00..3.72 rows=172 width=16) (actual time=0.012..0.065 rows=172 loops=5)

24. 0.344 0.344 ↑ 1.0 1 860 / 5

Index Scan using earlypaymentsettlement_invoice_idx on earlypaymentsettlement fi_eps (cost=0.43..8.45 rows=1 width=40) (actual time=0.002..0.002 rows=1 loops=860)

  • Index Cond: (invoice_id = nb.surplus_id)
  • Filter: (creationdate >= '2019-01-01'::date)
25. 0.344 0.344 ↑ 1.0 1 860 / 5

Index Scan using apfearlypaymentsettlement_pkey on apfearlypaymentsettlement fi_ps_apfeps (cost=0.42..0.45 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=860)

  • Index Cond: (id = fi_eps.id)
26. 0.161 0.172 ↑ 1.2 4 860 / 5

Materialize (cost=0.00..1.27 rows=5 width=8) (actual time=0.000..0.001 rows=4 loops=860)

27. 0.011 0.011 ↑ 1.0 5 5 / 5

Seq Scan on apfdebtoragreement fi_ps_apfeps_t_apfda (cost=0.00..1.25 rows=5 width=8) (actual time=0.007..0.011 rows=5 loops=5)

  • Filter: (bank_id = 3,053)
  • Rows Removed by Filter: 15
28. 0.153 0.153 ↑ 1.0 1 255 / 5

Index Scan using supplierinvoice_pkey on supplierinvoice fi_si (cost=0.43..0.64 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=255)

  • Index Cond: (id = fi_eps.invoice_id)
29. 0.089 0.102 ↑ 2.0 7 255 / 5

Materialize (cost=0.00..1.21 rows=14 width=28) (actual time=0.000..0.002 rows=7 loops=255)

30. 0.013 0.013 ↑ 1.0 14 5 / 5

Seq Scan on divisionbase od_db (cost=0.00..1.14 rows=14 width=28) (actual time=0.005..0.013 rows=14 loops=5)

31. 117.769 191.070 ↑ 2.1 166,262 5 / 5

Parallel Hash (cost=8,758.79..8,758.79 rows=346,379 width=24) (actual time=191.069..191.070 rows=166,262 loops=5)

  • Buckets: 1,048,576 Batches: 1 Memory Usage: 53,856kB
32. 73.301 73.301 ↑ 2.1 166,262 5 / 5

Parallel Seq Scan on apfearlypaymentsettlement ps_apfeps (cost=0.00..8,758.79 rows=346,379 width=24) (actual time=0.005..73.301 rows=166,262 loops=5)

33. 11.544 21.164 ↑ 1.0 20 962

Merge Right Join (cost=2.05..2.93 rows=20 width=26) (actual time=0.006..0.022 rows=20 loops=962)

  • Merge Cond: (ps_eps_t_bc_cb.id = ps_apfeps_t_apfda.bank_id)
34. 5.772 5.772 ↑ 275.0 6 962

Index Scan using corporatebase_pkey on corporatebase ps_eps_t_bc_cb (cost=0.28..234.48 rows=1,650 width=26) (actual time=0.004..0.006 rows=6 loops=962)

35. 3.838 3.848 ↑ 1.0 20 962

Sort (cost=1.63..1.68 rows=20 width=16) (actual time=0.000..0.004 rows=20 loops=962)

  • Sort Key: ps_apfeps_t_apfda.bank_id
  • Sort Method: quicksort Memory: 25kB
36. 0.010 0.010 ↑ 1.0 20 1

Seq Scan on apfdebtoragreement ps_apfeps_t_apfda (cost=0.00..1.20 rows=20 width=16) (actual time=0.003..0.010 rows=20 loops=1)

37. 4.810 4.810 ↓ 0.0 0 962

Index Scan using financingcontextbase_pkey on financingcontextbase ps_apffc_fc_fcb (cost=0.42..0.47 rows=1 width=24) (actual time=0.005..0.005 rows=0 loops=962)

  • Index Cond: (id = ps_apfeps.financingcontext_id)
38. 1.924 1.924 ↑ 1.0 1 962

Index Scan using apffinancingcontext_pkey on apffinancingcontext fi_ps_apffc_fc_afc (cost=0.42..0.46 rows=1 width=132) (actual time=0.002..0.002 rows=1 loops=962)

  • Index Cond: (fi_ps_apfeps.financingcontext_id = id)
39. 0.962 0.962 ↑ 1.0 1 962

Index Scan using corporatebase_pkey on corporatebase od_c_cb (cost=0.28..6.29 rows=1 width=26) (actual time=0.001..0.001 rows=1 loops=962)

  • Index Cond: (id = od_db.buyer_id)
40. 0.962 0.962 ↑ 1.0 1 962

Index Scan using corporatebase_pkey on corporatebase s_cb (cost=0.28..0.30 rows=1 width=26) (actual time=0.001..0.001 rows=1 loops=962)

  • Index Cond: (id = si.supplier_id)
41. 0.962 0.962 ↑ 1.0 1 962

Index Scan using crxcurrency_pkey on crxcurrency c (cost=0.13..0.15 rows=1 width=12) (actual time=0.001..0.001 rows=1 loops=962)

  • Index Cond: (si.currency_id = id)
42. 1.924 1.924 ↑ 1.0 1 962

Index Scan using arpimportbatch_pkey on arpimportbatch ib (cost=0.43..0.50 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=962)

  • Index Cond: (si.importbatch_id = id)
43. 0.962 0.962 ↑ 1.0 1 962

Index Scan using earlypaymentadvice_pkey on earlypaymentadvice fi_eps_epa (cost=0.28..0.29 rows=1 width=30) (actual time=0.001..0.001 rows=1 loops=962)

  • Index Cond: (id = fi_eps.earlypaymentadvice_id)
44. 0.000 0.000 ↓ 0.0 0 962

Index Scan using invoicepaymentadvice_pkey on invoicepaymentadvice fi_ipa (cost=0.14..0.15 rows=1 width=1,052) (actual time=0.000..0.000 rows=0 loops=962)

  • Index Cond: (fi_si.paymentadvice_id = id)
45. 0.000 0.000 ↓ 0.0 0 962

Index Scan using bankpaymenttransaction_mapping_idx on bankpaymenttransaction fi_bpt (cost=0.14..0.15 rows=1 width=16) (actual time=0.000..0.000 rows=0 loops=962)

  • Index Cond: (mapping_id = fi_eps.earlypaymentmapping_id)
46.          

SubPlan (for Nested Loop Left Join)

47. 0.962 0.962 ↑ 1.0 1 962

Aggregate (cost=8.15..8.16 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=962)

48. 0.000 0.000 ↓ 0.0 0 962

Index Scan using bankpaymenttransaction_mapping_idx on bankpaymenttransaction bpt (cost=0.14..8.15 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=962)

  • Index Cond: (mapping_id = fi_eps.maturitypaymentmapping_id)
Planning time : 12.860 ms
Execution time : 263.104 ms