explain.depesz.com

PostgreSQL's explain analyze made readable

Result: agjI

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 1,975.671 ↓ 0.0 0 1

GroupAggregate (cost=3,669.46..3,669.49 rows=1 width=158) (actual time=1,975.671..1,975.671 rows=0 loops=1)

  • Group Key: dt2.doc_type_name, de.doc_type_id, mm.supplier_contract_id
2.          

CTE cte

3. 1,585.889 1,645.237 ↑ 1.0 1 1

Aggregate (cost=1,864.63..1,864.65 rows=1 width=32) (actual time=1,645.237..1,645.237 rows=1 loops=1)

4. 59.348 59.348 ↓ 1.6 100,200 1

Seq Scan on money_movement (cost=0.00..1,555.42 rows=61,842 width=71) (actual time=0.030..59.348 rows=100,200 loops=1)

5. 0.059 1,975.669 ↓ 0.0 0 1

Sort (cost=1,804.82..1,804.82 rows=1 width=132) (actual time=1,975.669..1,975.669 rows=0 loops=1)

  • Sort Key: dt2.doc_type_name, de.doc_type_id, mm.supplier_contract_id
  • Sort Method: quicksort Memory: 25kB
6. 12.659 1,975.610 ↓ 0.0 0 1

Nested Loop (cost=6.56..1,804.81 rows=1 width=132) (actual time=1,975.610..1,975.610 rows=0 loops=1)

7. 2.830 1,962.951 ↓ 20,735.0 20,735 1

Nested Loop (cost=6.41..1,804.18 rows=1 width=14) (actual time=1,925.936..1,962.951 rows=20,735 loops=1)

8. 1,752.846 1,752.846 ↑ 1.0 1 1

CTE Scan on cte (cost=0.00..0.02 rows=1 width=32) (actual time=1,752.845..1,752.846 rows=1 loops=1)

9. 14.729 207.275 ↓ 20,735.0 20,735 1

Hash Join (cost=6.41..1,804.15 rows=1 width=14) (actual time=173.079..207.275 rows=20,735 loops=1)

  • Hash Cond: (mm.doc_edit_id = de.doc_edit_id)
10. 73.207 192.489 ↓ 263.5 121,220 1

Hash Join (cost=2.25..1,794.18 rows=460 width=14) (actual time=105.698..192.489 rows=121,220 loops=1)

  • Hash Cond: (mm.supplier_contract_id = l.supplier_contract_id)
11. 13.687 13.687 ↓ 1.6 100,200 1

Seq Scan on money_movement mm (cost=0.00..1,555.42 rows=61,842 width=14) (actual time=0.025..13.687 rows=100,200 loops=1)

12. 16.828 105.595 ↓ 1,002.0 100,200 1

Hash (cost=1.00..1.00 rows=100 width=4) (actual time=105.595..105.595 rows=100,200 loops=1)

  • Buckets: 131072 (originally 1024) Batches: 2 (originally 1) Memory Usage: 3073kB
13. 88.767 88.767 ↓ 1,002.0 100,200 1

Function Scan on jsonb_to_recordset l (cost=0.00..1.00 rows=100 width=4) (actual time=76.976..88.767 rows=100,200 loops=1)

14. 0.016 0.057 ↓ 1.0 97 1

Hash (cost=2.96..2.96 rows=96 width=8) (actual time=0.057..0.057 rows=97 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
15. 0.041 0.041 ↓ 1.0 97 1

Seq Scan on document_edition de (cost=0.00..2.96 rows=96 width=8) (actual time=0.024..0.041 rows=97 loops=1)

16. 0.000 0.000 ↓ 0.0 0 20,735

Index Scan using document_type_pkey on document_type dt2 (cost=0.15..0.63 rows=1 width=122) (actual time=0.000..0.000 rows=0 loops=20,735)

  • Index Cond: (doc_type_id = de.doc_type_id)