explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 41GAy

Settings
# exclusive inclusive rows x rows loops node
1. 12.573 316.459 ↑ 1.0 5,000 1

Limit (cost=1,099.20..16,125.41 rows=5,000 width=699) (actual time=91.528..316.459 rows=5,000 loops=1)

2. 7.226 303.886 ↑ 10.0 5,000 1

Nested Loop Left Join (cost=1,099.20..151,433.41 rows=50,024 width=699) (actual time=91.527..303.886 rows=5,000 loops=1)

3. 0.000 296.660 ↑ 10.0 5,000 1

Merge Join (cost=1,099.06..143,538.62 rows=50,024 width=671) (actual time=91.513..296.660 rows=5,000 loops=1)

  • Merge Cond: (v.pagante_id = c.pessoa_id)
4. 0.000 203.981 ↑ 10.0 5,000 1

Gather Merge (cost=1,002.82..123,712.28 rows=50,024 width=624) (actual time=91.287..203.981 rows=5,000 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 6.645 238.668 ↑ 11.9 1,757 3

Nested Loop Left Join (cost=2.79..116,938.24 rows=20,843 width=624) (actual time=1.363..79.556 rows=1,757 loops=3)

6. 7.290 232.023 ↑ 11.9 1,757 3

Nested Loop Left Join (cost=2.38..100,354.99 rows=20,843 width=601) (actual time=1.356..77.341 rows=1,757 loops=3)

7. 7.338 224.733 ↑ 11.9 1,757 3

Nested Loop Left Join (cost=1.96..83,771.36 rows=20,843 width=578) (actual time=1.343..74.911 rows=1,757 loops=3)

8. 7.122 217.395 ↑ 11.9 1,757 3

Nested Loop Left Join (cost=1.54..67,188.11 rows=20,843 width=555) (actual time=1.331..72.465 rows=1,757 loops=3)

9. 5.831 210.273 ↑ 11.9 1,757 3

Nested Loop (cost=1.13..50,604.86 rows=20,843 width=532) (actual time=1.319..70.091 rows=1,757 loops=3)

10. 11.085 183.354 ↑ 11.9 1,757 3

Nested Loop (cost=0.71..34,021.61 rows=20,843 width=509) (actual time=1.291..61.118 rows=1,757 loops=3)

11. 140.637 140.637 ↑ 11.9 1,757 3

Parallel Index Scan using idx_vendas_pagante_id on vendas v (cost=0.29..17,438.36 rows=20,843 width=486) (actual time=1.216..46.879 rows=1,757 loops=3)

12. 31.632 31.632 ↑ 1.0 1 5,272

Index Scan using pk_pessoa on pessoa u (cost=0.42..0.80 rows=1 width=39) (actual time=0.006..0.006 rows=1 loops=5,272)

  • Index Cond: (pessoa_id = v.vendedor_id)
13. 21.088 21.088 ↑ 1.0 1 5,272

Index Scan using pk_pessoa on pessoa l (cost=0.42..0.80 rows=1 width=39) (actual time=0.004..0.004 rows=1 loops=5,272)

  • Index Cond: (pessoa_id = v.empresa_id)
14. 0.000 0.000 ↓ 0.0 0 5,272

Index Scan using pk_pessoa on pessoa i (cost=0.42..0.80 rows=1 width=39) (actual time=0.000..0.000 rows=0 loops=5,272)

  • Index Cond: (v.intermediario_id = pessoa_id)
15. 0.000 0.000 ↓ 0.0 0 5,272

Index Scan using pk_pessoa on pessoa s (cost=0.42..0.80 rows=1 width=39) (actual time=0.000..0.000 rows=0 loops=5,272)

  • Index Cond: (v.solicitante_id = pessoa_id)
16. 0.000 0.000 ↓ 0.0 0 5,272

Index Scan using pk_pessoa on pessoa p (cost=0.42..0.80 rows=1 width=39) (actual time=0.000..0.000 rows=0 loops=5,272)

  • Index Cond: (v.promotor_id = pessoa_id)
17. 0.000 0.000 ↓ 0.0 0 5,272

Index Scan using pk_pessoa on pessoa a (cost=0.42..0.80 rows=1 width=39) (actual time=0.000..0.000 rows=0 loops=5,272)

  • Index Cond: (v.aprovador_id = pessoa_id)
18. 94.889 94.889 ↑ 10.0 6,927 1

Index Scan using pk_pessoa on pessoa c (cost=0.42..19,028.73 rows=68,926 width=63) (actual time=0.021..94.889 rows=6,927 loops=1)

19. 0.000 0.000 ↓ 0.0 0 5,000

Index Scan using pk_produtos on produtos pro (cost=0.14..0.16 rows=1 width=44) (actual time=0.000..0.000 rows=0 loops=5,000)

  • Index Cond: (id = v.operacao_propria_id)
Planning time : 43.615 ms