explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ISF4

Settings
# exclusive inclusive rows x rows loops node
1. 7.935 23,080.304 ↓ 3,807.0 3,807 1

Nested Loop Anti Join (cost=8,013.62..101,578.63 rows=1 width=926) (actual time=12,041.349..23,080.304 rows=3,807 loops=1)

2. 7.041 23,045.692 ↓ 3,811.0 3,811 1

Nested Loop (cost=8,013.20..101,564.96 rows=1 width=914) (actual time=12,033.563..23,045.692 rows=3,811 loops=1)

3. 7.638 22,691.850 ↓ 3,811.0 3,811 1

Nested Loop (cost=8,012.77..101,557.86 rows=1 width=765) (actual time=12,028.547..22,691.850 rows=3,811 loops=1)

4. 8.401 22,672.779 ↓ 3,811.0 3,811 1

Nested Loop (cost=8,012.48..101,550.95 rows=1 width=736) (actual time=12,024.360..22,672.779 rows=3,811 loops=1)

5. 0.000 22,652.945 ↓ 3,811.0 3,811 1

Nested Loop (cost=8,012.20..101,542.65 rows=1 width=712) (actual time=12,018.902..22,652.945 rows=3,811 loops=1)

6. 0.000 22,647.375 ↓ 3,811.0 3,811 1

Gather (cost=8,012.06..101,537.24 rows=1 width=660) (actual time=12,013.423..22,647.375 rows=3,811 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
7. 72.511 22,891.372 ↓ 1,270.0 1,270 3

Nested Loop (cost=7,012.06..100,537.14 rows=1 width=660) (actual time=8,528.919..22,891.372 rows=1,270 loops=3)

8. 21.781 22,818.858 ↓ 1,350.1 16,201 3

Hash Join (cost=7,011.76..100,454.23 rows=12 width=660) (actual time=615.709..22,818.858 rows=16,201 loops=3)

  • Hash Cond: (sa."frkConvenio" = plano.prk)
9. 4,956.734 22,795.537 ↓ 8.5 21,137 3

Nested Loop (cost=6,978.53..100,414.49 rows=2,475 width=240) (actual time=537.493..22,795.537 rows=21,137 loops=3)

10. 19.854 17,838.570 ↓ 8.8 21,137 3

Hash Left Join (cost=6,978.09..78,725.63 rows=2,402 width=223) (actual time=534.654..17,838.570 rows=21,137 loops=3)

  • Hash Cond: (prest."frkUfConselhoProfissional" = e.prk)
11. 19.548 17,818.679 ↓ 8.8 21,137 3

Hash Left Join (cost=6,952.57..78,693.77 rows=2,402 width=203) (actual time=534.302..17,818.679 rows=21,137 loops=3)

  • Hash Cond: (prest."frkConselhoProfissional" = cp.prk)
12. 31.701 17,799.096 ↓ 8.8 21,137 3

Hash Join (cost=6,934.47..78,669.31 rows=2,402 width=151) (actual time=534.241..17,799.096 rows=21,137 loops=3)

  • Hash Cond: (ate."frkPrestador" = prest.prk)
13. 2,824.416 17,637.879 ↓ 8.8 21,137 3

Nested Loop (cost=6,174.32..77,902.85 rows=2,402 width=118) (actual time=403.545..17,637.879 rows=21,137 loops=3)

14. 1,647.364 14,813.407 ↓ 20.5 49,314 3

Nested Loop (cost=6,173.89..59,853.16 rows=2,402 width=82) (actual time=392.131..14,813.407 rows=49,314 loops=3)

15. 6,223.223 13,166.013 ↓ 21.9 52,687 3

Nested Loop (cost=6,173.46..42,884.01 rows=2,402 width=54) (actual time=390.357..13,166.013 rows=52,687 loops=3)

16. 6,570.775 6,942.674 ↓ 21.9 52,693 3

Parallel Bitmap Heap Scan on "ServicoAgendado" sa (cost=6,173.03..24,676.01 rows=2,402 width=50) (actual time=386.861..6,942.674 rows=52,693 loops=3)

  • Recheck Cond: (("frkUnidadeAdministrativaLocalAgendamento" = 1263) AND ("frkCliente" = 189))
  • Heap Blocks: exact=17711
17. 3.338 371.899 ↓ 0.0 0 1

BitmapAnd (cost=6,173.03..6,173.03 rows=5,766 width=0) (actual time=371.899..371.899 rows=0 loops=1)

18. 173.111 173.111 ↑ 1.0 158,078 1

Bitmap Index Scan on "ServicoAgendado_UnidAge" (cost=0.00..3,030.73 rows=163,506 width=0) (actual time=173.110..173.111 rows=158,078 loops=1)

  • Index Cond: ("frkUnidadeAdministrativaLocalAgendamento" = 1263)
19. 195.450 195.450 ↑ 1.0 163,520 1

Bitmap Index Scan on "ServicoAgendado_idx_frkCliente" (cost=0.00..3,139.17 rows=169,432 width=0) (actual time=195.450..195.450 rows=163,520 loops=1)

  • Index Cond: ("frkCliente" = 189)
20. 0.116 0.116 ↑ 1.0 1 158,078

Index Scan using "PacienteAgendado_pkey" on "PacienteAgendado" pa (cost=0.43..7.58 rows=1 width=12) (actual time=0.116..0.116 rows=1 loops=158,078)

  • Index Cond: (prk = sa."frkPacienteAgendado")
21. 0.030 0.030 ↑ 1.0 1 158,061

Index Scan using "Paciente_pkey" on "Paciente" pac (cost=0.43..7.06 rows=1 width=36) (actual time=0.030..0.030 rows=1 loops=158,061)

  • Index Cond: (prk = pa."frkPaciente")
22. 0.056 0.056 ↓ 0.0 0 147,943

Index Scan using "Atendimento_pkey" on "Atendimento" ate (cost=0.43..7.51 rows=1 width=36) (actual time=0.056..0.056 rows=0 loops=147,943)

  • Index Cond: (prk = sa."frkAtendimento")
23. 7.055 129.516 ↓ 1.0 9,682 3

Hash (cost=639.51..639.51 rows=9,651 width=37) (actual time=129.515..129.516 rows=9,682 loops=3)

  • Buckets: 16384 Batches: 1 Memory Usage: 773kB
24. 122.461 122.461 ↓ 1.0 9,682 3

Seq Scan on "Prestador" prest (cost=0.00..639.51 rows=9,651 width=37) (actual time=0.015..122.461 rows=9,682 loops=3)

25. 0.011 0.035 ↑ 18.0 20 3

Hash (cost=13.60..13.60 rows=360 width=60) (actual time=0.034..0.035 rows=20 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
26. 0.024 0.024 ↑ 18.0 20 3

Seq Scan on "ConselhoProfissional" cp (cost=0.00..13.60 rows=360 width=60) (actual time=0.018..0.024 rows=20 loops=3)

27. 0.016 0.037 ↑ 25.6 27 3

Hash (cost=16.90..16.90 rows=690 width=28) (actual time=0.037..0.037 rows=27 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
28. 0.021 0.021 ↑ 25.6 27 3

Seq Scan on "Estado" e (cost=0.00..16.90 rows=690 width=28) (actual time=0.009..0.021 rows=27 loops=3)

29. 0.233 0.233 ↑ 2.0 1 63,411

Index Scan using "ServicoAgendadoServico_Sa" on "ServicoAgendadoServico" sas (cost=0.43..9.01 rows=2 width=21) (actual time=0.231..0.233 rows=1 loops=63,411)

  • Index Cond: ("frkServicoAgendado" = sa.prk)
30. 0.006 1.540 ↑ 4.5 2 3

Hash (cost=33.13..33.13 rows=9 width=424) (actual time=1.540..1.540 rows=2 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
31. 0.614 1.534 ↑ 4.5 2 3

Bitmap Heap Scan on "PlanoSaude" plano (cost=4.35..33.13 rows=9 width=424) (actual time=1.135..1.534 rows=2 loops=3)

  • Recheck Cond: ("frkOperadoraPlanoSaude" = 2034)
  • Heap Blocks: exact=2
32. 0.920 0.920 ↑ 4.5 2 3

Bitmap Index Scan on "PlanoSaude_idx1" (cost=0.00..4.34 rows=9 width=0) (actual time=0.920..0.920 rows=2 loops=3)

  • Index Cond: ("frkOperadoraPlanoSaude" = 2034)
33. 0.003 0.003 ↓ 0.0 0 48,602

Index Scan using "Agenda_pkey" on "Agenda" agend (cost=0.29..6.91 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=48,602)

  • Index Cond: (prk = sa."frkAgenda")
  • Filter: ((data >= '2019-05-28'::date) AND (data <= '2019-09-05'::date))
  • Rows Removed by Filter: 1
34. 7.622 7.622 ↑ 1.0 1 3,811

Index Scan using "Especialidade_pkey" on "Especialidade" espld (cost=0.14..5.36 rows=1 width=60) (actual time=0.002..0.002 rows=1 loops=3,811)

  • Index Cond: (prk = sa."frkEspecialidade")
35. 11.433 11.433 ↑ 1.0 1 3,811

Index Scan using "OperadoraPlanoSaude_pkey" on "OperadoraPlanoSaude" oplano (cost=0.28..8.29 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=3,811)

  • Index Cond: (prk = 2034)
36. 11.433 11.433 ↑ 1.0 1 3,811

Index Scan using "Servico_pkey" on "Servico" serv (cost=0.29..6.91 rows=1 width=33) (actual time=0.003..0.003 rows=1 loops=3,811)

  • Index Cond: (prk = sas."frkServico")
  • Filter: ((tipo <> 'R'::bpchar) AND (tipo <> 'C'::bpchar))
37. 346.801 346.801 ↑ 1.0 1 3,811

Index Scan using "ServicoPrestado_idx" on "ServicoPrestado" servp (cost=0.43..7.09 rows=1 width=157) (actual time=0.090..0.091 rows=1 loops=3,811)

  • Index Cond: ("frkAtendimento" = ate.prk)
38. 26.677 26.677 ↓ 0.0 0 3,811

Index Scan using "TissGuia_pkey" on "TissGuia" tg (cost=0.42..7.04 rows=1 width=12) (actual time=0.007..0.007 rows=0 loops=3,811)

  • Index Cond: ("frkServicoPrestado" = servp.prk)
Planning time : 47.219 ms
Execution time : 23,099.152 ms