explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uJ6Jo

Settings
# exclusive inclusive rows x rows loops node
1. 0.040 12.100 ↑ 4.2 19 1

Sort (cost=5,852.89..5,853.09 rows=80 width=215) (actual time=12.097..12.100 rows=19 loops=1)

  • Sort Key: ag.fec_agen
  • Sort Method: quicksort Memory: 29kB
2. 0.082 12.060 ↑ 4.2 19 1

Hash Left Join (cost=652.16..5,850.36 rows=80 width=215) (actual time=11.148..12.060 rows=19 loops=1)

  • Hash Cond: (ag.cod_agen = ag_1.cod_agen)
3. 0.065 5.159 ↑ 4.2 19 1

Hash Join (cost=111.32..5,304.11 rows=80 width=112) (actual time=4.264..5.159 rows=19 loops=1)

  • Hash Cond: (ag.rut_med = (m.rut_med)::double precision)
4. 0.031 2.101 ↑ 3.8 19 1

Nested Loop Left Join (cost=30.39..5,184.94 rows=73 width=96) (actual time=1.245..2.101 rows=19 loops=1)

5. 0.044 1.468 ↑ 1.4 14 1

Hash Join (cost=29.96..82.79 rows=20 width=92) (actual time=1.186..1.468 rows=14 loops=1)

  • Hash Cond: (ag.cod_sala = (s.cod_sala)::double precision)
6. 0.043 0.599 ↑ 1.4 14 1

Hash Join (cost=7.76..57.19 rows=20 width=86) (actual time=0.342..0.599 rows=14 loops=1)

  • Hash Cond: (ag.cod_suc = (su.cod_suc)::double precision)
7. 0.056 0.391 ↑ 1.4 14 1

Hash Join (cost=1.61..50.74 rows=20 width=74) (actual time=0.154..0.391 rows=14 loops=1)

  • Hash Cond: (ag.tipo_td = (at.cod_atencion)::double precision)
8. 0.281 0.281 ↑ 1.6 14 1

Index Scan using agenda_idx3 on agenda ag (cost=0.43..49.25 rows=22 width=70) (actual time=0.078..0.281 rows=14 loops=1)

  • Index Cond: (cod_pac = '860680'::double precision)
9. 0.024 0.054 ↑ 1.0 8 1

Hash (cost=1.08..1.08 rows=8 width=17) (actual time=0.054..0.054 rows=8 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.030 0.030 ↑ 1.0 8 1

Seq Scan on atencion at (cost=0.00..1.08 rows=8 width=17) (actual time=0.027..0.030 rows=8 loops=1)

11. 0.060 0.165 ↓ 1.0 53 1

Hash (cost=5.51..5.51 rows=51 width=20) (actual time=0.165..0.165 rows=53 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
12. 0.105 0.105 ↓ 1.0 53 1

Seq Scan on cliente_sucursal su (cost=0.00..5.51 rows=51 width=20) (actual time=0.023..0.105 rows=53 loops=1)

13. 0.460 0.825 ↓ 1.1 683 1

Hash (cost=14.31..14.31 rows=631 width=19) (actual time=0.825..0.825 rows=683 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 43kB
14. 0.365 0.365 ↓ 1.1 683 1

Seq Scan on sala s (cost=0.00..14.31 rows=631 width=19) (actual time=0.023..0.365 rows=683 loops=1)

15. 0.602 0.602 ↑ 96.0 1 14

Index Scan using log_eventos_idx_cast_double_id_evento on log_eventos log (cost=0.44..254.15 rows=96 width=8) (actual time=0.037..0.043 rows=1 loops=14)

  • Index Cond: ((id_evento)::double precision = ag.cod_agen)
16. 1.680 2.993 ↓ 1.0 2,056 1

Hash (cost=55.41..55.41 rows=2,041 width=31) (actual time=2.993..2.993 rows=2,056 loops=1)

  • Buckets: 4096 (originally 2048) Batches: 1 (originally 1) Memory Usage: 162kB
17. 1.313 1.313 ↓ 1.0 2,056 1

Seq Scan on medico m (cost=0.00..55.41 rows=2,041 width=31) (actual time=0.025..1.313 rows=2,056 loops=1)

18. 0.260 6.819 ↑ 16.1 449 1

Hash (cost=450.75..450.75 rows=7,207 width=87) (actual time=6.819..6.819 rows=449 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 120kB
19. 0.588 6.559 ↑ 16.1 449 1

Merge Join (cost=316.24..450.75 rows=7,207 width=87) (actual time=5.653..6.559 rows=449 loops=1)

  • Merge Cond: (ag_1.rut_med = ((m_1.rut_med)::double precision))
20. 0.416 2.655 ↑ 2.5 449 1

Sort (cost=148.62..151.44 rows=1,126 width=71) (actual time=2.594..2.655 rows=449 loops=1)

  • Sort Key: ag_1.rut_med
  • Sort Method: quicksort Memory: 88kB
21. 0.703 2.239 ↑ 2.5 449 1

Hash Join (cost=42.32..91.55 rows=1,126 width=71) (actual time=1.410..2.239 rows=449 loops=1)

  • Hash Cond: ((s_1.cod_sala)::double precision = ag_1.cod_sala)
22. 0.159 0.159 ↓ 1.1 683 1

Seq Scan on sala s_1 (cost=0.00..14.31 rows=631 width=19) (actual time=0.010..0.159 rows=683 loops=1)

23. 0.205 1.377 ↑ 1.0 449 1

Hash (cost=36.61..36.61 rows=457 width=65) (actual time=1.377..1.377 rows=449 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 53kB
24. 0.356 1.172 ↑ 1.0 449 1

Hash Left Join (cost=7.33..36.61 rows=457 width=65) (actual time=0.141..1.172 rows=449 loops=1)

  • Hash Cond: (ag_1.tipo_td = (at_1.cod_atencion)::double precision)
25. 0.447 0.798 ↑ 1.0 449 1

Hash Left Join (cost=6.15..28.57 rows=457 width=61) (actual time=0.105..0.798 rows=449 loops=1)

  • Hash Cond: (ag_1.cod_suc = (su_1.cod_suc)::double precision)
26. 0.267 0.267 ↑ 1.0 449 1

Seq Scan on agenda_reagendadas ag_1 (cost=0.00..15.57 rows=457 width=54) (actual time=0.004..0.267 rows=449 loops=1)

27. 0.056 0.084 ↓ 1.0 53 1

Hash (cost=5.51..5.51 rows=51 width=20) (actual time=0.084..0.084 rows=53 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
28. 0.028 0.028 ↓ 1.0 53 1

Seq Scan on cliente_sucursal su_1 (cost=0.00..5.51 rows=51 width=20) (actual time=0.005..0.028 rows=53 loops=1)

29. 0.013 0.018 ↑ 1.0 8 1

Hash (cost=1.08..1.08 rows=8 width=17) (actual time=0.018..0.018 rows=8 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
30. 0.005 0.005 ↑ 1.0 8 1

Seq Scan on atencion at_1 (cost=0.00..1.08 rows=8 width=17) (actual time=0.004..0.005 rows=8 loops=1)

31. 1.796 3.316 ↓ 1.1 2,241 1

Sort (cost=167.61..172.72 rows=2,041 width=31) (actual time=3.049..3.316 rows=2,241 loops=1)

  • Sort Key: ((m_1.rut_med)::double precision)
  • Sort Method: quicksort Memory: 265kB
32. 1.520 1.520 ↓ 1.0 2,056 1

Seq Scan on medico m_1 (cost=0.00..55.41 rows=2,041 width=31) (actual time=0.016..1.520 rows=2,056 loops=1)

Planning time : 4.047 ms