explain.depesz.com

PostgreSQL's explain analyze made readable

Result: j6vW

Settings
# exclusive inclusive rows x rows loops node
1. 19.077 37.368 ↓ 12.0 50,381 1

Nested Loop (cost=1.54..1,488.93 rows=4,214 width=20) (actual time=0.065..37.368 rows=50,381 loops=1)

2. 0.291 1.715 ↑ 2.3 296 1

Nested Loop (cost=1.12..966.09 rows=669 width=36) (actual time=0.037..1.715 rows=296 loops=1)

3. 0.124 0.500 ↑ 2.5 231 1

Nested Loop (cost=0.71..675.66 rows=584 width=40) (actual time=0.027..0.500 rows=231 loops=1)

4. 0.064 0.064 ↑ 1.0 39 1

Index Scan using contrato_test_1 on contrato c (cost=0.29..89.80 rows=39 width=24) (actual time=0.015..0.064 rows=39 loops=1)

  • Index Cond: (empresa_id = 1615)
5. 0.312 0.312 ↑ 4.0 6 39

Index Scan using item_contrato_test_2 on item_contrato ic (cost=0.42..14.78 rows=24 width=16) (actual time=0.005..0.008 rows=6 loops=39)

  • Index Cond: (contrato_id = c.id)
6. 0.924 0.924 ↑ 1.0 1 231

Index Scan using parcelamento_item_contrato_test_1 on parcelamento_item_contrato pic (cost=0.42..0.49 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=231)

  • Index Cond: (item_contrato = ic.id)
7. 16.576 16.576 ↓ 13.1 170 296

Index Only Scan using contrato_loja_test_1 on contrato_loja lc (cost=0.42..0.65 rows=13 width=8) (actual time=0.010..0.056 rows=170 loops=296)

  • Index Cond: (contrato_id = ic.contrato_id)
  • Heap Fetches: 0
Planning time : 1.390 ms
Execution time : 43.616 ms