explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.000 4,466.104 ↑ 586,012.0 5 1

Finalize GroupAggregate (cost=1,711,410.71..2,112,278.98 rows=2,930,060 width=270) (actual time=4,466.094..4,466.104 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,623.405 ↑ 406,952.7 6 1

Gather Merge (cost=1,711,410.71..2,032,923.20 rows=2,441,716 width=270) (actual time=4,466.082..4,623.405 rows=6 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.087 13,371.012 ↑ 610,429.0 2 3

Partial GroupAggregate (cost=1,710,410.68..1,750,088.57 rows=1,220,858 width=270) (actual time=4,457.002..4,457.004 rows=2 loops=3)

  • Group Key: c2.currency_code, dt2.doc_type_name, de.doc_type_id, mm.supplier_contract_id
4. 0.255 13,370.925 ↑ 610,429.0 2 3

Sort (cost=1,710,410.68..1,713,462.83 rows=1,220,858 width=237) (actual time=4,456.975..4,456.975 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.180 13,370.670 ↑ 610,429.0 2 3

Hash Join (cost=65.19..1,506,327.96 rows=1,220,858 width=237) (actual time=1,697.781..4,456.890 rows=2 loops=3)

  • Hash Cond: (de.doc_type_id = dt2.doc_type_id)
6. 0.228 13,370.262 ↑ 610,429.0 2 3

Hash Join (cost=63.67..1,489,539.65 rows=1,220,858 width=19) (actual time=1,697.647..4,456.754 rows=2 loops=3)

  • Hash Cond: (mm.currency_id = c2.currency_id)
7. 0.036 13,369.926 ↑ 610,429.0 2 3

Nested Loop (cost=2.82..1,486,268.04 rows=1,220,858 width=19) (actual time=1,697.536..4,456.642 rows=2 loops=3)

8. 8,357.202 13,369.704 ↑ 610,429.0 2 3

Hash Semi Join (cost=2.25..758,874.52 rows=1,220,858 width=19) (actual time=1,697.486..4,456.568 rows=2 loops=3)

  • Hash Cond: (mm.supplier_contract_id = id.id)
9. 5,012.373 5,012.373 ↑ 1.3 15,910,135 3

Parallel Seq Scan on money_movement mm (cost=0.00..693,084.80 rows=19,887,780 width=19) (actual time=0.025..1,670.791 rows=15,910,135 loops=3)

10. 0.054 0.129 ↑ 25.0 4 3

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

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

Function Scan on unnest id (cost=0.00..1.00 rows=100 width=4) (actual time=0.024..0.025 rows=4 loops=3)

12. 0.186 0.186 ↑ 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.031..0.031 rows=1 loops=6)

  • Index Cond: (doc_edit_id = mm.doc_edit_id)
13. 0.018 0.108 ↑ 188.3 12 3

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

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

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

15. 0.057 0.228 ↑ 1.0 23 3

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

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

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