explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 5,719.555 ↑ 586,312.6 5 1

Finalize GroupAggregate (cost=1,733,354.05..2,125,267.05 rows=2,931,563 width=262) (actual time=5,719.535..5,719.555 rows=5 loops=1)

  • Group Key: c2.currency_code, dt2.doc_type_name, de.doc_type_id, mm.supplier_contract_id
2. 0.000 5,877.214 ↑ 407,161.7 6 1

Gather Merge (cost=1,733,354.05..2,051,977.96 rows=2,442,970 width=262) (actual time=5,719.499..5,877.214 rows=6 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.090 17,106.339 ↑ 610,742.5 2 3

Partial GroupAggregate (cost=1,732,354.03..1,768,998.58 rows=1,221,485 width=262) (actual time=5,702.110..5,702.113 rows=2 loops=3)

  • Group Key: c2.currency_code, dt2.doc_type_name, de.doc_type_id, mm.supplier_contract_id
4. 0.507 17,106.249 ↑ 610,742.5 2 3

Sort (cost=1,732,354.03..1,735,407.74 rows=1,221,485 width=237) (actual time=5,702.082..5,702.083 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.186 17,105.742 ↑ 610,742.5 2 3

Hash Join (cost=65.19..1,528,162.40 rows=1,221,485 width=237) (actual time=2,941.226..5,701.914 rows=2 loops=3)

  • Hash Cond: (de.doc_type_id = dt2.doc_type_id)
6. 0.053 17,105.196 ↑ 610,742.5 2 3

Hash Join (cost=63.67..1,511,365.46 rows=1,221,485 width=19) (actual time=2,941.046..5,701.732 rows=2 loops=3)

  • Hash Cond: (mm.currency_id = c2.currency_id)
7. 0.042 17,105.073 ↑ 610,742.5 2 3

Nested Loop (cost=2.82..1,508,092.20 rows=1,221,485 width=19) (actual time=2,941.007..5,701.691 rows=2 loops=3)

8. 9,498.300 17,104.875 ↑ 610,973.0 2 3

Hash Join (cost=2.25..780,067.43 rows=1,221,946 width=19) (actual time=2,940.976..5,701.625 rows=2 loops=3)

  • Hash Cond: (mm.supplier_contract_id = l.supplier_contract_id)
9. 7,606.383 7,606.383 ↑ 1.3 15,907,792 3

Parallel Seq Scan on money_movement mm (cost=0.00..693,200.07 rows=19,905,507 width=19) (actual time=0.074..2,535.461 rows=15,907,792 loops=3)

10. 0.024 0.192 ↑ 25.0 4 3

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

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

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

12. 0.156 0.156 ↑ 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.026..0.026 rows=1 loops=6)

  • Index Cond: (doc_edit_id = mm.doc_edit_id)
13. 0.018 0.070 ↑ 188.3 12 2

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

  • Buckets: 4096 Batches: 1 Memory Usage: 33kB
14. 0.052 0.052 ↑ 188.3 12 2

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

15. 0.102 0.360 ↑ 1.0 23 3

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

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

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