explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 4,535.721 ↑ 585,954.4 5 1

Finalize GroupAggregate (cost=1,761,027.53..2,161,856.41 rows=2,929,772 width=270) (actual time=4,535.711..4,535.721 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,688.103 ↑ 406,912.7 6 1

Gather Merge (cost=1,761,027.53..2,082,508.43 rows=2,441,476 width=270) (actual time=4,535.698..4,688.103 rows=6 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.099 13,569.120 ↑ 610,369.0 2 3

Partial GroupAggregate (cost=1,760,027.51..1,799,701.50 rows=1,220,738 width=270) (actual time=4,523.038..4,523.040 rows=2 loops=3)

  • Group Key: c2.currency_code, dt2.doc_type_name, de.doc_type_id, mm.supplier_contract_id
4. 0.315 13,569.021 ↑ 610,369.0 2 3

Sort (cost=1,760,027.51..1,763,079.36 rows=1,220,738 width=237) (actual time=4,523.006..4,523.007 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.198 13,568.706 ↑ 610,369.0 2 3

Hash Join (cost=65.19..1,555,965.99 rows=1,220,738 width=237) (actual time=1,568.419..4,522.902 rows=2 loops=3)

  • Hash Cond: (de.doc_type_id = dt2.doc_type_id)
6. 0.093 13,568.148 ↑ 610,369.0 2 3

Hash Join (cost=63.67..1,539,179.32 rows=1,220,738 width=19) (actual time=1,568.235..4,522.716 rows=2 loops=3)

  • Hash Cond: (mm.currency_id = c2.currency_id)
7. 0.039 13,567.929 ↑ 610,369.0 2 3

Nested Loop (cost=2.82..1,535,908.03 rows=1,220,738 width=19) (actual time=1,568.163..4,522.643 rows=2 loops=3)

8. 4,664.508 13,567.704 ↑ 610,369.0 2 3

Hash Semi Join (cost=2.25..808,584.49 rows=1,220,738 width=19) (actual time=1,568.111..4,522.568 rows=2 loops=3)

  • Hash Cond: (mm.supplier_contract_id = l.supplier_contract_id)
9. 8,903.052 8,903.052 ↑ 1.2 15,910,049 3

Parallel Seq Scan on money_movement mm (cost=0.00..742,801.23 rows=19,885,826 width=19) (actual time=0.035..2,967.684 rows=15,910,049 loops=3)

  • Filter: (dt < '2020-01-02 00:00:00'::timestamp without time zone)
10. 0.027 0.144 ↑ 25.0 4 3

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

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

Function Scan on jsonb_to_recordset l (cost=0.00..1.00 rows=100 width=4) (actual time=0.038..0.039 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.036 0.126 ↑ 188.3 12 3

Hash (cost=32.60..32.60 rows=2,260 width=8) (actual time=0.042..0.042 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.093 0.360 ↑ 1.0 23 3

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

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

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