explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OjJG

Settings
# exclusive inclusive rows x rows loops node
1. 0.045 14,088.645 ↑ 6.6 15 1

Sort (cost=1,183,985.25..1,183,985.50 rows=99 width=215) (actual time=14,088.642..14,088.645 rows=15 loops=1)

  • Sort Key: ag.fec_agen
  • Sort Method: quicksort Memory: 28kB
2. 0.049 14,088.600 ↑ 6.6 15 1

Nested Loop Left Join (cost=85.21..1,183,981.97 rows=99 width=215) (actual time=14,082.550..14,088.600 rows=15 loops=1)

3. 5.882 14,088.266 ↑ 6.6 15 1

Nested Loop (cost=55.80..1,176,831.74 rows=99 width=112) (actual time=14,082.430..14,088.266 rows=15 loops=1)

  • Join Filter: (ag.cod_sala = (s.cod_sala)::double precision)
  • Rows Removed by Join Filter: 10425
4. 0.216 0.216 ↑ 1.0 696 1

Seq Scan on sala s (cost=0.00..16.10 rows=710 width=19) (actual time=0.022..0.216 rows=696 loops=1)

5. 0.761 14,082.168 ↑ 6.1 15 696

Materialize (cost=55.80..1,175,672.77 rows=92 width=106) (actual time=20.215..20.233 rows=15 loops=696)

6. 20.131 14,081.407 ↑ 6.1 15 1

Nested Loop (cost=55.80..1,175,672.31 rows=92 width=106) (actual time=14,069.615..14,081.407 rows=15 loops=1)

  • Join Filter: (ag.rut_med = (m.rut_med)::double precision)
  • Rows Removed by Join Filter: 32955
7. 0.670 0.670 ↑ 1.0 2,198 1

Seq Scan on medico m (cost=0.00..60.35 rows=2,235 width=31) (actual time=0.013..0.670 rows=2,198 loops=1)

8. 1.743 14,060.606 ↑ 4.9 15 2,198

Materialize (cost=55.80..1,172,717.82 rows=74 width=90) (actual time=4.016..6.397 rows=15 loops=2,198)

9. 0.483 14,058.863 ↑ 4.9 15 1

Nested Loop (cost=55.80..1,172,717.45 rows=74 width=90) (actual time=8,827.993..14,058.863 rows=15 loops=1)

  • Join Filter: (ag.cod_suc = (su.cod_suc)::double precision)
  • Rows Removed by Join Filter: 810
10. 0.240 14,058.230 ↑ 5.2 15 1

Nested Loop (cost=55.80..1,172,642.20 rows=78 width=78) (actual time=8,827.893..14,058.230 rows=15 loops=1)

  • Join Filter: (ag.tipo_td = (at.cod_atencion)::double precision)
  • Rows Removed by Join Filter: 105
11. 6,217.847 14,057.930 ↑ 5.9 15 1

Hash Right Join (cost=55.80..1,172,628.64 rows=89 width=74) (actual time=8,827.858..14,057.930 rows=15 loops=1)

  • Hash Cond: ((log.id_evento)::double precision = ag.cod_agen)
12. 7,839.770 7,839.770 ↑ 1.0 26,429,471 1

Seq Scan on log_eventos log (cost=0.00..1,040,412.30 rows=26,431,930 width=8) (actual time=0.018..7,839.770 rows=26,429,471 loops=1)

13. 0.021 0.313 ↑ 2.5 10 1

Hash (cost=55.49..55.49 rows=25 width=70) (actual time=0.313..0.313 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
14. 0.292 0.292 ↑ 2.5 10 1

Index Scan using agenda_idx3 on agenda ag (cost=0.43..55.49 rows=25 width=70) (actual time=0.119..0.292 rows=10 loops=1)

  • Index Cond: (cod_pac = '860680'::double precision)
15. 0.052 0.060 ↑ 1.0 8 15

Materialize (cost=0.00..1.12 rows=8 width=17) (actual time=0.003..0.004 rows=8 loops=15)

16. 0.008 0.008 ↑ 1.0 8 1

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

17. 0.102 0.150 ↓ 1.1 55 15

Materialize (cost=0.00..5.76 rows=51 width=20) (actual time=0.002..0.010 rows=55 loops=15)

18. 0.048 0.048 ↓ 1.1 55 1

Seq Scan on cliente_sucursal su (cost=0.00..5.51 rows=51 width=20) (actual time=0.012..0.048 rows=55 loops=1)

19. 0.072 0.285 ↓ 0.0 0 15

Hash Join (cost=29.41..101.14 rows=19 width=87) (actual time=0.019..0.019 rows=0 loops=15)

  • Hash Cond: ((m_1.rut_med)::double precision = ag_1.rut_med)
20. 0.018 0.018 ↑ 2,235.0 1 1

Seq Scan on medico m_1 (cost=0.00..60.35 rows=2,235 width=31) (actual time=0.018..0.018 rows=1 loops=1)

21. 0.015 0.195 ↓ 0.0 0 15

Hash (cost=29.37..29.37 rows=3 width=71) (actual time=0.013..0.013 rows=0 loops=15)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
22. 0.038 0.180 ↓ 0.0 0 15

Hash Join (cost=9.69..29.37 rows=3 width=71) (actual time=0.012..0.012 rows=0 loops=15)

  • Hash Cond: ((s_1.cod_sala)::double precision = ag_1.cod_sala)
23. 0.007 0.007 ↑ 710.0 1 1

Seq Scan on sala s_1 (cost=0.00..16.10 rows=710 width=19) (actual time=0.007..0.007 rows=1 loops=1)

24. 0.015 0.135 ↓ 0.0 0 15

Hash (cost=9.68..9.68 rows=1 width=65) (actual time=0.009..0.009 rows=0 loops=15)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
25. 0.000 0.120 ↓ 0.0 0 15

Nested Loop Left Join (cost=2.70..9.68 rows=1 width=65) (actual time=0.008..0.008 rows=0 loops=15)

  • Join Filter: ((at_1.cod_atencion)::double precision = ag_1.tipo_td)
26. 0.045 0.120 ↓ 0.0 0 15

Hash Right Join (cost=2.70..8.48 rows=1 width=61) (actual time=0.008..0.008 rows=0 loops=15)

  • Hash Cond: ((su_1.cod_suc)::double precision = ag_1.cod_suc)
27. 0.000 0.000 ↓ 0.0 0

Seq Scan on cliente_sucursal su_1 (cost=0.00..5.51 rows=51 width=20) (never executed)

28. 0.015 0.075 ↓ 0.0 0 15

Hash (cost=2.69..2.69 rows=1 width=54) (actual time=0.005..0.005 rows=0 loops=15)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
29. 0.060 0.060 ↓ 0.0 0 15

Index Scan using agenda_reagendadas_idx_cod_agen on agenda_reagendadas ag_1 (cost=0.27..2.69 rows=1 width=54) (actual time=0.004..0.004 rows=0 loops=15)

  • Index Cond: (cod_agen = ag.cod_agen)
30. 0.000 0.000 ↓ 0.0 0

Seq Scan on atencion at_1 (cost=0.00..1.08 rows=8 width=17) (never executed)

Planning time : 6.789 ms