explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LKPJ

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.004 309,763.832 ↑ 1.0 1 1

Limit (cost=115,327.89..115,327.90 rows=1 width=8) (actual time=309,763.830..309,763.832 rows=1 loops=1)

2. 16.107 309,763.828 ↑ 1.0 1 1

Aggregate (cost=115,327.89..115,327.90 rows=1 width=8) (actual time=309,763.827..309,763.828 rows=1 loops=1)

3. 67.379 309,747.721 ↓ 12,816.0 12,816 1

Nested Loop (cost=14,307.96..115,327.89 rows=1 width=8) (actual time=212.632..309,747.721 rows=12,816 loops=1)

4. 41.676 309,526.550 ↓ 12,816.0 12,816 1

Nested Loop (cost=14,307.96..115,324.63 rows=1 width=16) (actual time=212.622..309,526.550 rows=12,816 loops=1)

5. 49.617 309,369.530 ↓ 12,816.0 12,816 1

Nested Loop (cost=14,307.53..115,320.50 rows=1 width=24) (actual time=212.603..309,369.530 rows=12,816 loops=1)

  • Join Filter: (conhecimen6_.oid_conhecimento = conhecimen7_.oid_conhecimento)
6. 55.805 309,281.465 ↓ 12,816.0 12,816 1

Nested Loop (cost=14,307.10..115,312.78 rows=1 width=48) (actual time=212.596..309,281.465 rows=12,816 loops=1)

  • Join Filter: (conhecimen6_.oid_conhecimento = conhecimen5_.oid_conhecimento)
7. 59.489 309,110.316 ↓ 12,816.0 12,816 1

Nested Loop (cost=14,306.66..115,305.07 rows=1 width=40) (actual time=212.583..309,110.316 rows=12,816 loops=1)

  • Join Filter: (notasfisca2_.oid_nota_fiscal = notafiscal3_.oid_nota_fiscal)
8. 144,456.858 308,922.667 ↓ 12,816.0 12,816 1

Nested Loop (cost=14,306.23..115,297.35 rows=1 width=56) (actual time=212.565..308,922.667 rows=12,816 loops=1)

  • Join Filter: (agendament0_.oid_transportadora = transporta1_.oid_transportadora)
  • Rows Removed by Join Filter: 350530416
9. 60.469 805.489 ↓ 12,816.0 12,816 1

Nested Loop (cost=14,306.23..114,207.14 rows=1 width=64) (actual time=209.572..805.489 rows=12,816 loops=1)

  • Join Filter: (conhecimen6_.oid_conhecimento = conhecimen4_.oid_conhecimento)
  • Rows Removed by Join Filter: 4001
10. 283.498 580.548 ↓ 1.1 13,706 1

Hash Join (cost=14,305.79..19,067.65 rows=12,310 width=48) (actual time=209.548..580.548 rows=13,706 loops=1)

  • Hash Cond: (notasfisca2_.oid_agendamento_entrega = agendament0_.oid_agendamento_entrega)
11. 87.709 87.709 ↑ 1.0 182,153 1

Seq Scan on nota_fiscal_agend_entrega notasfisca2_ (cost=0.00..2,812.88 rows=182,588 width=16) (actual time=0.008..87.709 rows=182,153 loops=1)

12. 7.261 209.341 ↑ 1.0 11,815 1

Hash (cost=14,157.37..14,157.37 rows=11,874 width=48) (actual time=209.341..209.341 rows=11,815 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 924kB
13. 107.666 202.080 ↑ 1.0 11,815 1

Hash Join (cost=9,515.11..14,157.37 rows=11,874 width=48) (actual time=17.937..202.080 rows=11,815 loops=1)

  • Hash Cond: (conhecimen6_.oid_agendamento_entrega = agendament0_.oid_agendamento_entrega)
14. 76.665 76.665 ↓ 1.0 178,146 1

Seq Scan on conhecimento_agend_entrega conhecimen6_ (cost=0.00..2,743.26 rows=178,026 width=16) (actual time=0.006..76.665 rows=178,146 loops=1)

15. 6.087 17.749 ↑ 1.0 11,600 1

Hash (cost=9,368.27..9,368.27 rows=11,747 width=32) (actual time=17.749..17.749 rows=11,600 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 725kB
16. 10.555 11.662 ↑ 1.0 11,600 1

Bitmap Heap Scan on agendamento_entrega agendament0_ (cost=371.46..9,368.27 rows=11,747 width=32) (actual time=1.492..11.662 rows=11,600 loops=1)

  • Recheck Cond: (oid_empresa = 5::bigint)
17. 1.107 1.107 ↑ 1.0 11,601 1

Bitmap Index Scan on idx_agendamento_entrega_empresa (cost=0.00..368.52 rows=11,747 width=0) (actual time=1.107..1.107 rows=11,601 loops=1)

  • Index Cond: (oid_empresa = 5::bigint)
18. 164.472 164.472 ↑ 1.0 1 13,706

Index Scan using idx_nota_fiscal_conhecimento_oid_nota_fiscal on nota_fiscal_conhecimento conhecimen4_ (cost=0.43..7.72 rows=1 width=16) (actual time=0.009..0.012 rows=1 loops=13,706)

  • Index Cond: (oid_nota_fiscal = notasfisca2_.oid_nota_fiscal)
19. 163,660.320 163,660.320 ↑ 1.0 27,352 12,816

Seq Scan on transportadora transporta1_ (cost=0.00..747.87 rows=27,387 width=8) (actual time=0.004..12.770 rows=27,352 loops=12,816)

20. 128.160 128.160 ↑ 1.0 1 12,816

Index Only Scan using pk_nota_fiscal on nota_fiscal notafiscal3_ (cost=0.43..7.70 rows=1 width=8) (actual time=0.010..0.010 rows=1 loops=12,816)

  • Index Cond: (oid_nota_fiscal = conhecimen4_.oid_nota_fiscal)
  • Heap Fetches: 12816
21. 115.344 115.344 ↑ 1.0 1 12,816

Index Only Scan using pk_conhecimento on conhecimento conhecimen5_ (cost=0.43..7.70 rows=1 width=8) (actual time=0.009..0.009 rows=1 loops=12,816)

  • Index Cond: (oid_conhecimento = conhecimen4_.oid_conhecimento)
  • Heap Fetches: 12816
22. 38.448 38.448 ↑ 1.0 1 12,816

Index Only Scan using pk_conhecimento on conhecimento conhecimen7_ (cost=0.43..7.70 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=12,816)

  • Index Cond: (oid_conhecimento = conhecimen5_.oid_conhecimento)
  • Heap Fetches: 12816
23. 115.344 115.344 ↑ 1.0 1 12,816

Index Only Scan using pk_pessoa on pessoa pessoa8_ (cost=0.43..4.12 rows=1 width=8) (actual time=0.008..0.009 rows=1 loops=12,816)

  • Index Cond: (oid_pessoa = agendament0_.oid_destinatario)
  • Heap Fetches: 40
24. 153.792 153.792 ↑ 1.0 1 12,816

Seq Scan on empresa empresa9_ (cost=0.00..3.25 rows=1 width=8) (actual time=0.005..0.012 rows=1 loops=12,816)

  • Filter: (oid_empresa = 5::bigint)
  • Rows Removed by Filter: 101