explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bPNr

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 4,474.745 ↑ 585,965.0 5 1

Finalize GroupAggregate (cost=1,782,056.70..2,173,737.10 rows=2,929,825 width=262) (actual time=4,474.713..4,474.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,634.213 ↑ 406,920.0 6 1

Gather Merge (cost=1,782,056.70..2,100,491.49 rows=2,441,520 width=262) (actual time=4,474.678..4,634.213 rows=6 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.081 13,393.158 ↑ 610,380.0 2 3

Partial GroupAggregate (cost=1,781,056.68..1,817,679.48 rows=1,220,760 width=262) (actual time=4,464.381..4,464.386 rows=2 loops=3)

  • Group Key: c2.currency_code, dt2.doc_type_name, de.doc_type_id, mm.supplier_contract_id
4. 0.357 13,393.077 ↑ 610,380.0 2 3

Sort (cost=1,781,056.68..1,784,108.58 rows=1,220,760 width=237) (actual time=4,464.358..4,464.359 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.225 13,392.720 ↑ 610,380.0 2 3

Hash Join (cost=65.19..1,576,992.77 rows=1,220,760 width=237) (actual time=2,397.099..4,464.240 rows=2 loops=3)

  • Hash Cond: (de.doc_type_id = dt2.doc_type_id)
6. 0.063 13,392.252 ↑ 610,380.0 2 3

Hash Join (cost=63.67..1,560,205.80 rows=1,220,760 width=19) (actual time=2,396.946..4,464.084 rows=2 loops=3)

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

Nested Loop (cost=2.82..1,556,934.45 rows=1,220,760 width=19) (actual time=2,396.904..4,464.039 rows=2 loops=3)

8. 4,592.982 13,391.910 ↑ 610,380.0 2 3

Hash Join (cost=2.25..829,597.82 rows=1,220,760 width=19) (actual time=2,396.866..4,463.970 rows=2 loops=3)

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

Parallel Seq Scan on money_movement mm (cost=0.00..742,814.77 rows=19,886,188 width=19) (actual time=0.047..2,932.934 rows=15,910,336 loops=3)

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

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

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

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

12. 0.168 0.168 ↑ 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.028..0.028 rows=1 loops=6)

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

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

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

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

15. 0.075 0.243 ↑ 1.0 23 3

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

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

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