explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Wu6F

Settings
# exclusive inclusive rows x rows loops node
1. 664.711 1,852.614 ↓ 80.9 25,798 1

Sort (cost=6,553.04..6,553.83 rows=319 width=197) (actual time=1,821.819..1,852.614 rows=25,798 loops=1)

  • Sort Key: pessoa.pessoa_nomefantasia
  • Sort Method: external merge Disk: 4752kB
  • Buffers: shared hit=156105, temp read=1016 written=1017
2. 187.448 1,187.903 ↓ 80.9 25,798 1

Nested Loop (cost=2,305.5..6,539.77 rows=319 width=197) (actual time=67.165..1,187.903 rows=25,798 loops=1)

  • Buffers: shared hit=156105, temp read=422 written=422
3. 202.630 303.909 ↓ 80.9 25,798 1

Hash Join (cost=2,305.22..3,779.52 rows=319 width=141) (actual time=67.089..303.909 rows=25,798 loops=1)

  • Buffers: shared hit=2235, temp read=422 written=422
4. 34.288 34.288 ↓ 1.0 33,135 1

Seq Scan on pessoaendereco pessoaendereco (cost=0..1,387.33 rows=33,131 width=12) (actual time=0.079..34.288 rows=33,135 loops=1)

  • Filter: (pessoaendereco.pessoaendereco_tipo = 0)
  • Buffers: shared hit=928
5. 40.648 66.991 ↓ 80.9 25,798 1

Hash (cost=2,301.23..2,301.23 rows=319 width=137) (actual time=66.991..66.991 rows=25,798 loops=1)

  • Buffers: shared hit=1307, temp written=234
6. 26.343 26.343 ↓ 80.9 25,798 1

Seq Scan on pessoa pessoa (cost=0..2,301.23 rows=319 width=137) (actual time=0.039..26.343 rows=25,798 loops=1)

  • Filter: ((COALESCE(pessoa.empresa_id, 0) = ANY ('{0,1}'::integer[])) AND (pessoa.pessoa_status = 1) AND ((pessoa.pessoa_iscliente = 1) OR (pessoa.pessoa_isfuncionario = 1) OR (pessoa.pessoa_isvendedor = 1) OR (pessoa.pessoa_isfornecedor = 1) OR (pessoa.pessoa_istransportadora = 1) OR (pessoa.pessoa_isrepresentante = 1)))
  • Buffers: shared hit=1307
7. 283.778 283.778 ↑ 1.0 1 25,798

Index Scan using pk_cidade on cidade cidade (cost=0.28..0.31 rows=1 width=28) (actual time=0.011..0.011 rows=1 loops=25,798)

  • Index Cond: (cidade.cidade_id = pessoaendereco.cidade_id)
  • Buffers: shared hit=77382
8.          

SubPlan (for Nested Loop)

9. 128.990 412.768 ↑ 1.0 1 25,798

Aggregate (cost=8.34..8.35 rows=1 width=32) (actual time=0.016..0.016 rows=1 loops=25,798)

  • Buffers: shared hit=76488
10. 283.778 283.778 ↑ 1.0 2 25,798

Index Scan using idx_pessoatelefone on pessoatelefone pessoatelefone (cost=0.29..8.33 rows=2 width=8) (actual time=0.009..0.011 rows=2 loops=25,798)

  • Index Cond: (pessoatelefone.pessoa_id = pessoa.pessoa_id)
  • Buffers: shared hit=76488