explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iTBf : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #EE8W; plan #aohP; plan #4BI6; plan #wQLk; plan #7byJC; plan #9jE3

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 4,480.745 ↑ 586,009.6 5 1

Finalize GroupAggregate (cost=1,711,401.96..2,112,268.59 rows=2,930,048 width=270) (actual time=4,480.670..4,480.745 rows=5 loops=1)

  • Group Key: c2.currency_code, dt2.doc_type_name, de.doc_type_id, mm.supplier_contract_id
2. 0.000 4,671.109 ↑ 406,951.0 6 1

Gather Merge (cost=1,711,401.96..2,032,913.14 rows=2,441,706 width=270) (actual time=4,480.649..4,671.109 rows=6 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.171 13,404.747 ↑ 610,426.5 2 3

Partial GroupAggregate (cost=1,710,401.94..1,750,079.66 rows=1,220,853 width=270) (actual time=4,468.245..4,468.249 rows=2 loops=3)

  • Group Key: c2.currency_code, dt2.doc_type_name, de.doc_type_id, mm.supplier_contract_id
4. 0.435 13,404.576 ↑ 610,426.5 2 3

Sort (cost=1,710,401.94..1,713,454.07 rows=1,220,853 width=237) (actual time=4,468.191..4,468.192 rows=2 loops=3)

  • Sort Key: c2.currency_code, dt2.doc_type_name, de.doc_type_id, mm.supplier_contract_id
  • Sort Method: quicksort Memory: 25kB
5. 0.447 13,404.141 ↑ 610,426.5 2 3

Hash Join (cost=65.19..1,506,321.81 rows=1,220,853 width=237) (actual time=1,446.254..4,468.047 rows=2 loops=3)

  • Hash Cond: (de.doc_type_id = dt2.doc_type_id)
6. 0.111 13,403.241 ↑ 610,426.5 2 3

Hash Join (cost=63.67..1,489,533.56 rows=1,220,853 width=19) (actual time=1,445.957..4,467.747 rows=2 loops=3)

  • Hash Cond: (mm.currency_id = c2.currency_id)
7. 0.048 13,403.010 ↑ 610,426.5 2 3

Nested Loop (cost=2.82..1,486,261.96 rows=1,220,853 width=19) (actual time=1,445.883..4,467.670 rows=2 loops=3)

8. 8,389.284 13,402.758 ↑ 610,426.5 2 3

Hash Semi Join (cost=2.25..758,871.44 rows=1,220,853 width=19) (actual time=1,445.823..4,467.586 rows=2 loops=3)

  • Hash Cond: (mm.supplier_contract_id = l.supplier_contract_id)
9. 5,013.285 5,013.285 ↑ 1.3 15,910,064 3

Parallel Seq Scan on money_movement mm (cost=0.00..693,081.99 rows=19,887,699 width=19) (actual time=0.042..1,671.095 rows=15,910,064 loops=3)

10. 0.027 0.189 ↑ 25.0 4 3

Hash (cost=1.00..1.00 rows=100 width=4) (actual time=0.063..0.063 rows=4 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.162 0.162 ↑ 25.0 4 3

Function Scan on jsonb_to_recordset l (cost=0.00..1.00 rows=100 width=4) (actual time=0.052..0.054 rows=4 loops=3)

12. 0.204 0.204 ↑ 1.0 1 6

Index Scan using ix_document_edition_doc_edit_id on document_edition de (cost=0.56..0.60 rows=1 width=8) (actual time=0.034..0.034 rows=1 loops=6)

  • Index Cond: (doc_edit_id = mm.doc_edit_id)
13. 0.036 0.120 ↑ 188.3 12 3

Hash (cost=32.60..32.60 rows=2,260 width=8) (actual time=0.040..0.040 rows=12 loops=3)

  • Buckets: 4096 Batches: 1 Memory Usage: 33kB
14. 0.084 0.084 ↑ 188.3 12 3

Seq Scan on currency c2 (cost=0.00..32.60 rows=2,260 width=8) (actual time=0.026..0.028 rows=12 loops=3)

15. 0.201 0.453 ↑ 1.0 23 3

Hash (cost=1.23..1.23 rows=23 width=222) (actual time=0.151..0.151 rows=23 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
16. 0.252 0.252 ↑ 1.0 23 3

Seq Scan on document_type dt2 (cost=0.00..1.23 rows=23 width=222) (actual time=0.071..0.084 rows=23 loops=3)