explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IeKP

Settings
# exclusive inclusive rows x rows loops node
1. 1,031.267 29,825.642 ↑ 120.8 43,164 1

Hash Join (cost=72,545.14..1,445,751.20 rows=5,215,106 width=603) (actual time=17,100.751..29,825.642 rows=43,164 loops=1)

  • Hash Cond: (pdi.idpoliticacabecalho = pdc.idpoliticacabecalho)
  • Buffers: shared hit=39,764 read=674,952 written=820, temp read=1,348 written=1,348
2. 28,469.980 28,469.980 ↑ 1.7 5,749,793 1

Seq Scan on politicadesconto_itens pdi (cost=0.00..808,940.44 rows=9,775,644 width=16) (actual time=1.265..28,469.980 rows=5,749,793 loops=1)

  • Buffers: shared hit=37,938 read=673,246 written=179
3. 1.845 324.395 ↑ 26.1 618 1

Hash (cost=71,159.16..71,159.16 rows=16,159 width=576) (actual time=324.395..324.395 rows=618 loops=1)

  • Buckets: 16,384 Batches: 2 Memory Usage: 298kB
  • Buffers: shared hit=1,826 read=1,706 written=641, temp written=22
4. 4.475 322.550 ↑ 26.1 618 1

Nested Loop Left Join (cost=0.97..71,159.16 rows=16,159 width=576) (actual time=1.795..322.550 rows=618 loops=1)

  • Join Filter: pdc.usa_cliente
  • Buffers: shared hit=1,826 read=1,706 written=641
5. 232.173 232.173 ↓ 1.2 618 1

Index Scan using politicadesconto_cabecalho_idfornecedor_idx on politicadesconto_cabecalho pdc (cost=0.42..906.14 rows=511 width=577) (actual time=0.872..232.173 rows=618 loops=1)

  • Index Cond: ((idfornecedor = '11fa19b2-fc88-49c6-ad0c-8a764042f2cf'::uuid) AND (now() >= vigencia_inicial) AND (now() <= vigencia_final))
  • Filter: ((NOT usa_cliente) AND (delivery OR (delivery IS NULL)))
  • Rows Removed by Filter: 6
  • Buffers: shared hit=244 read=665 written=241
6. 85.902 85.902 ↓ 0.0 0 618

Index Only Scan using politicadesconto_cliente_idpoliticacabecalho_idx on politicadesconto_cliente pcli (cost=0.56..121.97 rows=1,551 width=16) (actual time=0.139..0.139 rows=0 loops=618)

  • Index Cond: (idpoliticacabecalho = pdc.idpoliticacabecalho)
  • Heap Fetches: 0
  • Buffers: shared hit=1,582 read=1,041 written=400
Planning time : 0.687 ms
Execution time : 29,828.302 ms