explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 98vN

Settings
# exclusive inclusive rows x rows loops node
1. 724.713 91,133.919 ↓ 4.3 431,905 1

Gather (cost=40,050.69..2,494,051.04 rows=100,391 width=699) (actual time=2,581.970..91,133.919 rows=431,905 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 211.976 90,409.206 ↓ 3.4 143,968 3 / 3

Hash Join (cost=39,050.69..2,483,011.94 rows=41,830 width=699) (actual time=3,033.282..90,409.206 rows=143,968 loops=3)

  • Hash Cond: ("Ras.Det.ResponsavelLancamento".fk_courier = "Ras.Det.ResponsavelLancamento.Courier".codigo)
3. 418.703 90,196.848 ↓ 3.4 143,968 3 / 3

Nested Loop (cost=39,033.57..2,482,883.30 rows=41,830 width=703) (actual time=3,032.790..90,196.848 rows=143,968 loops=3)

4. 379.028 86,610.842 ↓ 3.4 143,968 3 / 3

Hash Join (cost=39,033.01..2,378,403.74 rows=41,830 width=135) (actual time=3,032.682..86,610.842 rows=143,968 loops=3)

  • Hash Cond: ("Ras.Det".fk_usuario = "Ras.Det.ResponsavelLancamento".codigo)
5. 47,380.735 86,217.860 ↓ 5.7 422,805 3 / 3

Hash Join (cost=35,664.21..2,374,839.30 rows=74,476 width=80) (actual time=2,712.266..86,217.860 rows=422,805 loops=3)

  • Hash Cond: ("Ras".fk_detalhamento = "Ras.Det".codigo)
6. 36,174.306 36,174.306 ↑ 1.2 55,361,193 3 / 3

Parallel Seq Scan on "Rastreamento" "Ras" (cost=0.00..2,158,515.80 rows=68,822,580 width=28) (actual time=0.044..36,174.306 rows=55,361,193 loops=3)

7. 876.699 2,662.819 ↓ 10.5 875,801 3 / 3

Hash (cost=34,619.95..34,619.95 rows=83,541 width=60) (actual time=2,662.819..2,662.819 rows=875,801 loops=3)

  • Buckets: 524288 (originally 131072) Batches: 2 (originally 1) Memory Usage: 31533kB
8. 1,786.120 1,786.120 ↓ 10.5 875,801 3 / 3

Index Scan using idx_rastramento_detalhamento_data_hora_ocorrencia on "RastreamentoDetalhamento" "Ras.Det" (cost=0.57..34,619.95 rows=83,541 width=60) (actual time=0.037..1,786.120 rows=875,801 loops=3)

  • Index Cond: ((data_hora_ocorrencia >= '2020-01-27 00:00:00-03'::timestamp with time zone) AND (data_hora_ocorrencia <= '2020-02-03 23:59:00-03'::timestamp with time zone))
  • Filter: (fk_ocorrencia <> ALL ('{1,2,4,5,6,7,8,9,79}'::integer[]))
  • Rows Removed by Filter: 298145
9. 2.249 13.954 ↓ 1.0 3,185 3 / 3

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

  • Buckets: 4096 Batches: 1 Memory Usage: 327kB
10. 9.722 11.705 ↓ 1.0 3,185 3 / 3

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

  • Recheck Cond: (fk_entregador IS NOT NULL)
  • Filter: (codigo <> 10)
  • Heap Blocks: exact=1637
11. 1.983 1.983 ↓ 1.0 3,186 3 / 3

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

  • Index Cond: (fk_entregador IS NOT NULL)
12. 3,167.303 3,167.303 ↑ 1.0 1 431,905 / 3

Index Scan using "Remessa_pkey" on "Remessa" (cost=0.56..2.50 rows=1 width=568) (actual time=0.022..0.022 rows=1 loops=431,905)

  • Index Cond: ((codigo)::text = ("Ras".fk_remessa)::text)
13. 0.151 0.382 ↑ 1.0 272 3 / 3

Hash (cost=13.72..13.72 rows=272 width=4) (actual time=0.381..0.382 rows=272 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
14. 0.231 0.231 ↑ 1.0 272 3 / 3

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

Planning time : 1.162 ms
Execution time : 91,359.468 ms