explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FlP8

Settings
# exclusive inclusive rows x rows loops node
1. 2,822.864 89,237.563 ↓ 4.3 432,359 1

Gather (cost=40,050.69..2,494,051.14 rows=100,391 width=699) (actual time=3,429.797..89,237.563 rows=432,359 loops=1)

  • Output: "Remessa".foto_recebedor_coleta, "Remessa".foto_recebedor, "Remessa".bol, "Remessa".ar_digital, "Remessa".data_ar, "Remessa".codigo, "Remessa".fk_situacao_remessa, "Ras".codigo, "Ras".fk_remessa, "Ras.Det".codigo, "Ras.Det".fk_local_lancamento, "Ras.Det".data_hora_ocorrencia, "Ras.Det".foto_iteracao, "Ras.Det".fk_ocorrencia, "Ras.Det.ResponsavelLancamento".codigo, "Ras.Det.ResponsavelLancamento".nome, "Ras.Det.ResponsavelLancamento".img, "Ras.Det.ResponsavelLancamento".fk_entregador
  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=4573379 read=1515814 dirtied=42 written=38, temp read=622979 written=622973
  • I/O Timings: read=6004.590 write=0.359
2. 206.489 86,414.699 ↓ 3.4 144,120 3 / 3

Hash Join (cost=39,050.69..2,483,012.04 rows=41,830 width=699) (actual time=3,498.314..86,414.699 rows=144,120 loops=3)

  • Output: "Remessa".foto_recebedor_coleta, "Remessa".foto_recebedor, "Remessa".bol, "Remessa".ar_digital, "Remessa".data_ar, "Remessa".codigo, "Remessa".fk_situacao_remessa, "Ras".codigo, "Ras".fk_remessa, "Ras.Det".codigo, "Ras.Det".fk_local_lancamento, "Ras.Det".data_hora_ocorrencia, "Ras.Det".foto_iteracao, "Ras.Det".fk_ocorrencia, "Ras.Det.ResponsavelLancamento".codigo, "Ras.Det.ResponsavelLancamento".nome, "Ras.Det.ResponsavelLancamento".img, "Ras.Det.ResponsavelLancamento".fk_entregador
  • Inner Unique: true
  • Hash Cond: ("Ras.Det.ResponsavelLancamento".fk_courier = "Ras.Det.ResponsavelLancamento.Courier".codigo)
  • Buffers: shared hit=4573379 read=1515814 dirtied=42 written=38, temp read=622979 written=622973
  • I/O Timings: read=6004.590 write=0.359
  • Worker 0: actual time=3514.505..86394.683 rows=131566 loops=1
  • Buffers: shared hit=1471882 read=494113 dirtied=19 written=15, temp read=206933 written=206931
  • I/O Timings: read=1906.692 write=0.123
  • Worker 1: actual time=3551.947..87224.729 rows=159550 loops=1
  • Buffers: shared hit=1605769 read=501534 dirtied=13 written=8, temp read=208025 written=208023
  • I/O Timings: read=1958.999 write=0.054
3. 467.034 86,207.655 ↓ 3.4 144,120 3 / 3

Nested Loop (cost=39,033.57..2,482,883.40 rows=41,830 width=703) (actual time=3,497.597..86,207.655 rows=144,120 loops=3)

  • Output: "Remessa".foto_recebedor_coleta, "Remessa".foto_recebedor, "Remessa".bol, "Remessa".ar_digital, "Remessa".data_ar, "Remessa".codigo, "Remessa".fk_situacao_remessa, "Ras".codigo, "Ras".fk_remessa, "Ras.Det".codigo, "Ras.Det".fk_local_lancamento, "Ras.Det".data_hora_ocorrencia, "Ras.Det".foto_iteracao, "Ras.Det".fk_ocorrencia, "Ras.Det.ResponsavelLancamento".codigo, "Ras.Det.ResponsavelLancamento".nome, "Ras.Det.ResponsavelLancamento".img, "Ras.Det.ResponsavelLancamento".fk_entregador, "Ras.Det.ResponsavelLancamento".fk_courier
  • Inner Unique: true
  • Buffers: shared hit=4573258 read=1515814 dirtied=42 written=38, temp read=622979 written=622973
  • I/O Timings: read=6004.590 write=0.359
  • Worker 0: actual time=3513.666..86195.572 rows=131566 loops=1
  • Buffers: shared hit=1471827 read=494113 dirtied=19 written=15, temp read=206933 written=206931
  • I/O Timings: read=1906.692 write=0.123
  • Worker 1: actual time=3551.091..87005.421 rows=159550 loops=1
  • Buffers: shared hit=1605714 read=501534 dirtied=13 written=8, temp read=208025 written=208023
  • I/O Timings: read=1958.999 write=0.054
4. 371.825 82,858.228 ↓ 3.4 144,120 3 / 3

Hash Join (cost=39,033.01..2,378,403.74 rows=41,830 width=135) (actual time=3,497.508..82,858.228 rows=144,120 loops=3)

  • Output: "Ras".codigo, "Ras".fk_remessa, "Ras.Det".codigo, "Ras.Det".fk_local_lancamento, "Ras.Det".data_hora_ocorrencia, "Ras.Det".foto_iteracao, "Ras.Det".fk_ocorrencia, "Ras.Det.ResponsavelLancamento".codigo, "Ras.Det.ResponsavelLancamento".nome, "Ras.Det.ResponsavelLancamento".img, "Ras.Det.ResponsavelLancamento".fk_entregador, "Ras.Det.ResponsavelLancamento".fk_courier
  • Inner Unique: true
  • Hash Cond: ("Ras.Det".fk_usuario = "Ras.Det.ResponsavelLancamento".codigo)
  • Buffers: shared hit=2415515 read=1511758 dirtied=42 written=38, temp read=622979 written=622973
  • I/O Timings: read=5964.854 write=0.359
  • Worker 0: actual time=3513.559..82879.489 rows=131566 loops=1
  • Buffers: shared hit=815148 read=492960 dirtied=19 written=15, temp read=206933 written=206931
  • I/O Timings: read=1894.800 write=0.123
  • Worker 1: actual time=3550.988..83458.063 rows=159550 loops=1
  • Buffers: shared hit=809419 read=500077 dirtied=13 written=8, temp read=208025 written=208023
  • I/O Timings: read=1945.160 write=0.054
5. 45,220.603 82,467.089 ↓ 5.7 423,059 3 / 3

Hash Join (cost=35,664.21..2,374,839.30 rows=74,476 width=80) (actual time=3,355.219..82,467.089 rows=423,059 loops=3)

  • Output: "Ras".codigo, "Ras".fk_remessa, "Ras.Det".codigo, "Ras.Det".fk_local_lancamento, "Ras.Det".data_hora_ocorrencia, "Ras.Det".foto_iteracao, "Ras.Det".fk_ocorrencia, "Ras.Det".fk_usuario
  • Inner Unique: true
  • Hash Cond: ("Ras".fk_detalhamento = "Ras.Det".codigo)
  • Buffers: shared hit=2409615 read=1511674 dirtied=42 written=38, temp read=622979 written=622973
  • I/O Timings: read=5963.982 write=0.359
  • Worker 0: actual time=3339.463..82500.254 rows=381659 loops=1
  • Buffers: shared hit=813153 read=492960 dirtied=19 written=15, temp read=206933 written=206931
  • I/O Timings: read=1894.800 write=0.123
  • Worker 1: actual time=3356.924..83039.299 rows=459711 loops=1
  • Buffers: shared hit=807425 read=500076 dirtied=13 written=8, temp read=208025 written=208023
  • I/O Timings: read=1945.139 write=0.054
6. 33,968.983 33,968.983 ↑ 1.2 55,361,659 3 / 3

Parallel Seq Scan on public."Rastreamento" "Ras" (cost=0.00..2,158,515.80 rows=68,822,580 width=28) (actual time=0.069..33,968.983 rows=55,361,659 loops=3)

  • Output: "Ras".codigo, "Ras".fk_remessa, "Ras".fk_detalhamento, "Ras".info_retorno
  • Buffers: shared hit=3109 read=1467181 dirtied=41 written=29
  • I/O Timings: read=5554.463 write=0.223
  • Worker 0: actual time=0.081..33965.516 rows=55118700 loops=1
  • Buffers: shared hit=1029 read=488080 dirtied=19 written=15
  • I/O Timings: read=1845.324 write=0.123
  • Worker 1: actual time=0.080..33923.781 rows=55366029 loops=1
  • Buffers: shared hit=1043 read=489452 dirtied=12 written=8
  • I/O Timings: read=1844.831 write=0.054
7. 987.708 3,277.503 ↓ 10.5 876,413 3 / 3

Hash (cost=34,619.95..34,619.95 rows=83,541 width=60) (actual time=3,277.503..3,277.503 rows=876,413 loops=3)

  • Output: "Ras.Det".codigo, "Ras.Det".fk_local_lancamento, "Ras.Det".data_hora_ocorrencia, "Ras.Det".foto_iteracao, "Ras.Det".fk_ocorrencia, "Ras.Det".fk_usuario
  • Buckets: 524288 (originally 131072) Batches: 2 (originally 1) Memory Usage: 31553kB
  • Buffers: shared hit=2406478 read=44493 dirtied=1 written=9, temp written=8322
  • I/O Timings: read=409.519 write=0.136
  • Worker 0: actual time=3283.115..3283.115 rows=876413 loops=1
  • Buffers: shared hit=812110 read=4880, temp written=2774
  • I/O Timings: read=49.477
  • Worker 1: actual time=3298.458..3298.458 rows=876413 loops=1
  • Buffers: shared hit=806368 read=10624 dirtied=1, temp written=2774
  • I/O Timings: read=100.308
8. 2,289.795 2,289.795 ↓ 10.5 876,413 3 / 3

Index Scan using idx_rastramento_detalhamento_data_hora_ocorrencia on public."RastreamentoDetalhamento" "Ras.Det" (cost=0.57..34,619.95 rows=83,541 width=60) (actual time=0.061..2,289.795 rows=876,413 loops=3)

  • Output: "Ras.Det".codigo, "Ras.Det".fk_local_lancamento, "Ras.Det".data_hora_ocorrencia, "Ras.Det".foto_iteracao, "Ras.Det".fk_ocorrencia, "Ras.Det".fk_usuario
  • Index Cond: (("Ras.Det".data_hora_ocorrencia >= '2020-01-27 00:00:00-03'::timestamp with time zone) AND ("Ras.Det".data_hora_ocorrencia <= '2020-02-03 23:59:00-03'::timestamp with time zone))
  • Filter: ("Ras.Det".fk_ocorrencia <> ALL ('{1,2,4,5,6,7,8,9,79}'::integer[]))
  • Rows Removed by Filter: 298159
  • Buffers: shared hit=2406478 read=44493 dirtied=1 written=9
  • I/O Timings: read=409.519 write=0.136
  • Worker 0: actual time=0.080..2288.118 rows=876413 loops=1
  • Buffers: shared hit=812110 read=4880
  • I/O Timings: read=49.477
  • Worker 1: actual time=0.076..2294.223 rows=876413 loops=1
  • Buffers: shared hit=806368 read=10624 dirtied=1
  • I/O Timings: read=100.308
9. 3.299 19.314 ↓ 1.0 3,185 3 / 3

Hash (cost=3,329.00..3,329.00 rows=3,184 width=59) (actual time=19.314..19.314 rows=3,185 loops=3)

  • Output: "Ras.Det.ResponsavelLancamento".codigo, "Ras.Det.ResponsavelLancamento".nome, "Ras.Det.ResponsavelLancamento".img, "Ras.Det.ResponsavelLancamento".fk_entregador, "Ras.Det.ResponsavelLancamento".fk_courier
  • Buckets: 4096 Batches: 1 Memory Usage: 327kB
  • Buffers: shared hit=5900 read=84
  • I/O Timings: read=0.873
  • Worker 0: actual time=24.176..24.177 rows=3185 loops=1
  • Buffers: shared hit=1995
  • Worker 1: actual time=24.384..24.384 rows=3185 loops=1
  • Buffers: shared hit=1994 read=1
  • I/O Timings: read=0.021
10. 13.020 16.015 ↓ 1.0 3,185 3 / 3

Bitmap Heap Scan on public."Usuario" "Ras.Det.ResponsavelLancamento" (cost=443.09..3,329.00 rows=3,184 width=59) (actual time=3.214..16.015 rows=3,185 loops=3)

  • Output: "Ras.Det.ResponsavelLancamento".codigo, "Ras.Det.ResponsavelLancamento".nome, "Ras.Det.ResponsavelLancamento".img, "Ras.Det.ResponsavelLancamento".fk_entregador, "Ras.Det.ResponsavelLancamento".fk_courier
  • Recheck Cond: ("Ras.Det.ResponsavelLancamento".fk_entregador IS NOT NULL)
  • Filter: ("Ras.Det.ResponsavelLancamento".codigo <> 10)
  • Heap Blocks: exact=1637
  • Buffers: shared hit=5900 read=84
  • I/O Timings: read=0.873
  • Worker 0: actual time=3.724..20.371 rows=3185 loops=1
  • Buffers: shared hit=1995
  • Worker 1: actual time=3.894..20.686 rows=3185 loops=1
  • Buffers: shared hit=1994 read=1
  • I/O Timings: read=0.021
11. 2.995 2.995 ↑ 1.0 3,185 3 / 3

Bitmap Index Scan on "Usuaurio_fk_entregador_key" (cost=0.00..442.30 rows=3,185 width=0) (actual time=2.994..2.995 rows=3,185 loops=3)

  • Index Cond: ("Ras.Det.ResponsavelLancamento".fk_entregador IS NOT NULL)
  • Buffers: shared hit=989 read=84
  • I/O Timings: read=0.873
  • Worker 0: actual time=3.484..3.485 rows=3185 loops=1
  • Buffers: shared hit=358
  • Worker 1: actual time=3.659..3.659 rows=3185 loops=1
  • Buffers: shared hit=357 read=1
  • I/O Timings: read=0.021
12. 2,882.393 2,882.393 ↑ 1.0 1 432,359 / 3

Index Scan using "Remessa_pkey" on public."Remessa" (cost=0.56..2.50 rows=1 width=568) (actual time=0.020..0.020 rows=1 loops=432,359)

  • Output: "Remessa".codigo, "Remessa".pedido, "Remessa"."pedido_II", "Remessa".destinatario, "Remessa".empresa, "Remessa".departamento, "Remessa".inscricao_municipal, "Remessa".inscricao_estadual, "Remessa".cpf_cnpj, "Remessa".cep, "Remessa".tipo_endereco, "Remessa".endereco, "Remessa".numero, "Remessa".bairro, "Remessa".cidade, "Remessa".complemento, "Remessa".ponto_referencia, "Remessa".telefone1, "Remessa".ramal1, "Remessa".telefone2, "Remessa".ramal2, "Remessa".celular, "Remessa".email, "Remessa".autorizado_recebimento1, "Remessa".docto_autorizado_recebimento1, "Remessa".autorizado_recebimento2, "Remessa".docto_autorizado_recebimento2, "Remessa".autorizado_recebimento3, "Remessa".docto_autorizado_recebimento3, "Remessa".obs, "Remessa".peso_real, "Remessa".quantidade_item_remessa, "Remessa".fk_estado, "Remessa".chave, "Remessa".cte, "Remessa".peso_cubado, "Remessa".peso_arquivado, "Remessa".peso_taxado, "Remessa".frete, "Remessa".frete_total, "Remessa".base_calculo_imposto, "Remessa".valor_iss, "Remessa".valor_icms, "Remessa".valor_remessa, "Remessa".data_finalizacao, "Remessa".numero_postagem, "Remessa".data_coleta, "Remessa".data_cliente, "Remessa".data_conciliacao, "Remessa".data_disponibilidade, "Remessa".data_recebimento, "Remessa".data_solicitacao_manuseio, "Remessa".data_prazo_manuseio, "Remessa".data_prevista_entrega_reversa, "Remessa".postagem, "Remessa".qtde_tentativas_entrega_reversa, "Remessa".cad_ip, "Remessa".cad_user, "Remessa".cad_lat, "Remessa".cad_long, "Remessa".cad_alt, "Remessa".fk_courier_origem, "Remessa".fk_courier_destino, "Remessa".fk_localidade_courier_destino, "Remessa".fk_localidade_courier_origem, "Remessa".fk_localidade, "Remessa".fk_tipo_remessa, "Remessa".fk_prioridade, "Remessa".fk_ultima_ocorrencia_rastreamento, "Remessa".fk_ordem_coleta, "Remessa".fk_servico, "Remessa".fk_ultima_ocorrencia, "Remessa".fk_centro_custo, "Remessa".data_baixa, "Remessa".ar_enviado, "Remessa".data_cadastro, "Remessa".recebedor_final, "Remessa".doc_recebedor_final, "Remessa".fk_parentesco_final, "Remessa".data_ar, "Remessa".data_tratativa, "Remessa".fk_tratativa, "Remessa".qtde_tentativas_total, "Remessa".fk_ocorrencia_devolucao, "Remessa".seq_postagem, "Remessa".venc_tratativa, "Remessa".user_block, "Remessa".fk_courier_destino1, "Remessa".courier_change, "Remessa".data_ultima_ocorrencia, "Remessa".entregador_final, "Remessa".enviar_postagem, "Remessa".fk_insucesso, "Remessa".qtde_tratativa, "Remessa".fk_situacao_remessa, "Remessa".data_transferencia, "Remessa"."COD", "Remessa".reimpressao_ar, "Remessa".fragmentada, "Remessa".coleta_entrega_prazo, "Remessa".qtde_dias_entrega_coleta, "Remessa".data_rota, "Remessa".recalcular_prazo, "Remessa".fk_conciliacao, "Remessa".fk_recebimento, "Remessa".fk_transferencia, "Remessa".fk_baixa, "Remessa".fk_rota, "Remessa".fk_arquivo_processado, "Remessa".rms_vinculada_antiga, "Remessa".rms_vinculada_nova, "Remessa".qtde_dias_sem_movimento, "Remessa".order_arq, "Remessa".fk_courier_coleta, "Remessa".cep_coleta, "Remessa".nota_fiscal, "Remessa".conhecimento_gerado, "Remessa".coleta_agendada, "Remessa".coleta_agendada_data, "Remessa".beneficiarios, "Remessa".insumos, "Remessa".insumos_coleta, "Remessa".insumos_coleta2, "Remessa".solicitante, "Remessa".bol, "Remessa".nao_aplica_volume_peso_qtde, "Remessa".qtde_cal, "Remessa".geo, "Remessa".geo_coleta, "Remessa".pode_alterar_npc, "Remessa".fk_rota_coleta_entrega, "Remessa".exigir_beneficio, "Remessa".altura, "Remessa".comprimento, "Remessa".largura, "Remessa".tipo_beneficio, "Remessa".ret_custodia, "Remessa".dados_ar, "Remessa".fk_cliente, "Remessa".ar_digital, "Remessa".info_rota_auto, "Remessa".fk_ultimo_motivo_tratativa, "Remessa".fk_courier_com_a_remessa, "Remessa".local_preenchido, "Remessa".nf_email_agendamento_enviado, "Remessa".frete_dedicado, "Remessa".frete_dedicado_obs, "Remessa".tipo_frete_dedicado, "Remessa".frete_a_pagar, "Remessa".aux_3, "Remessa".aux_1, "Remessa".aux_2, "Remessa".aux_4, "Remessa".aux_5, "Remessa".cpf_cnpj_remetente, "Remessa".data_previsao_cliente, "Remessa".evento_idx_correios, "Remessa".tipo_e_status_correios, "Remessa".foto_recebedor, "Remessa".foto_recebedor_coleta, "Remessa".materiais, "Remessa".tipo_abrangencia, "Remessa".temp_pedido_1, "Remessa".desconto_fatura, "Remessa".tipo_desconto_fatura, "Remessa".desconto_fatura_obs, "Remessa".fk_fatura, "Remessa".id_cliente, "Remessa".tratativa_iniciada, "Remessa".data_previsao_coleta, "Remessa".manuseio, "Remessa".prerota, "Remessa".captura_esteira, "Remessa".qtde_dias_prazo
  • Index Cond: (("Remessa".codigo)::text = ("Ras".fk_remessa)::text)
  • Buffers: shared hit=2157743 read=4056
  • I/O Timings: read=39.735
  • Worker 0: actual time=0.022..0.022 rows=1 loops=131566
  • Buffers: shared hit=656679 read=1153
  • I/O Timings: read=11.892
  • Worker 1: actual time=0.019..0.019 rows=1 loops=159550
  • Buffers: shared hit=796295 read=1457
  • I/O Timings: read=13.839
13. 0.235 0.555 ↑ 1.0 272 3 / 3

Hash (cost=13.72..13.72 rows=272 width=4) (actual time=0.554..0.555 rows=272 loops=3)

  • Output: "Ras.Det.ResponsavelLancamento.Courier".codigo
  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
  • Buffers: shared hit=33
  • Worker 0: actual time=0.615..0.615 rows=272 loops=1
  • Buffers: shared hit=11
  • Worker 1: actual time=0.604..0.605 rows=272 loops=1
  • Buffers: shared hit=11
14. 0.320 0.320 ↑ 1.0 272 3 / 3

Seq Scan on public."Courier" "Ras.Det.ResponsavelLancamento.Courier" (cost=0.00..13.72 rows=272 width=4) (actual time=0.025..0.320 rows=272 loops=3)

  • Output: "Ras.Det.ResponsavelLancamento.Courier".codigo
  • Buffers: shared hit=33
  • Worker 0: actual time=0.034..0.361 rows=272 loops=1
  • Buffers: shared hit=11
  • Worker 1: actual time=0.033..0.364 rows=272 loops=1
  • Buffers: shared hit=11
Planning time : 1.436 ms
Execution time : 89,472.022 ms