explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wnJx : Optimization for: plan #yjMh

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,487,837.95..6,185,948.51 rows=5 width=4) (actual rows= loops=)

  • Hash Cond: ((lt.num_cpf_cnpj = (pj1.num_cnpj)::text) AND (lt2.num_cpf_cnpj = (pj2.num_cnpj)::text))
2. 0.000 0.000 ↓ 0.0

Merge Join (cost=115,962.31..138,270.57 rows=1,182,258 width=32) (actual rows= loops=)

  • Merge Cond: (lt.cd_itens_il = lt2.cd_itens_il)
  • Join Filter: (lt2.num_cpf_cnpj <> lt.num_cpf_cnpj)
3. 0.000 0.000 ↓ 0.0

Sort (cost=58,295.79..59,088.13 rows=316,937 width=22) (actual rows= loops=)

  • Sort Key: lt.cd_itens_il
4. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,290.86..29,337.51 rows=316,937 width=22) (actual rows= loops=)

  • Hash Cond: (lt.cd_processo_adm = l.cd_processo_adm)
5. 0.000 0.000 ↓ 0.0

Seq Scan on vw_licitantes_itens lt (cost=0.00..19,335.75 rows=411,075 width=22) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Hash (cost=5,048.16..5,048.16 rows=19,416 width=4) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Seq Scan on vw_licitacoes l (cost=0.00..5,048.16 rows=19,416 width=4) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Sort (cost=57,666.52..58,694.21 rows=411,075 width=18) (actual rows= loops=)

  • Sort Key: lt2.cd_itens_il
9. 0.000 0.000 ↓ 0.0

Seq Scan on vw_licitantes_itens lt2 (cost=0.00..19,335.75 rows=411,075 width=18) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Hash (cost=4,145,283.47..4,145,283.47 rows=47,649,078 width=60) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Merge Join (cost=3,260,237.48..4,145,283.47 rows=47,649,078 width=60) (actual rows= loops=)

  • Merge Cond: ((s1.num_cnpj)::text = (s2.num_cnpj)::text)
  • Join Filter: ((s2.num_cnpj_empresa)::text <> (s1.num_cnpj_empresa)::text)
12. 0.000 0.000 ↓ 0.0

Sort (cost=1,630,118.74..1,647,180.45 rows=6,824,682 width=45) (actual rows= loops=)

  • Sort Key: s1.num_cnpj
13. 0.000 0.000 ↓ 0.0

Hash Join (cost=213,583.41..645,497.31 rows=6,824,682 width=45) (actual rows= loops=)

  • Hash Cond: ((s1.num_cnpj_empresa)::text = (pj1.num_cnpj)::text)
14. 0.000 0.000 ↓ 0.0

Seq Scan on vw_socio s1 (cost=0.00..321,012.82 rows=6,824,682 width=32) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash (cost=171,690.96..171,690.96 rows=3,351,396 width=15) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Seq Scan on vw_cnpj pj1 (cost=0.00..171,690.96 rows=3,351,396 width=15) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Materialize (cost=1,630,118.74..1,664,242.15 rows=6,824,682 width=45) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Sort (cost=1,630,118.74..1,647,180.45 rows=6,824,682 width=45) (actual rows= loops=)

  • Sort Key: s2.num_cnpj
19. 0.000 0.000 ↓ 0.0

Hash Join (cost=213,583.41..645,497.31 rows=6,824,682 width=45) (actual rows= loops=)

  • Hash Cond: ((s2.num_cnpj_empresa)::text = (pj2.num_cnpj)::text)
20. 0.000 0.000 ↓ 0.0

Seq Scan on vw_socio s2 (cost=0.00..321,012.82 rows=6,824,682 width=32) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash (cost=171,690.96..171,690.96 rows=3,351,396 width=15) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Seq Scan on vw_cnpj pj2 (cost=0.00..171,690.96 rows=3,351,396 width=15) (actual rows= loops=)