explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vQmg

Settings
# exclusive inclusive rows x rows loops node
1. 0.208 663.606 ↓ 122.0 122 1

Sort (cost=1,548.23..1,548.24 rows=1 width=62) (actual time=663.601..663.606 rows=122 loops=1)

  • Sort Key: ((tu.nombre_tur)::time without time zone), p1.codigo_med, p1.codigo_jor, p1.consul_pga
  • Sort Method: quicksort Memory: 42kB
2. 0.833 663.398 ↓ 122.0 122 1

Nested Loop Left Join (cost=1,126.42..1,548.22 rows=1 width=62) (actual time=16.617..663.398 rows=122 loops=1)

  • Join Filter: (ce.codigo_tur = tu.codigo_tur)
  • Rows Removed by Join Filter: 68
  • Filter: (ce.codigo_cex IS NULL)
  • Rows Removed by Filter: 4
3. 0.088 10.893 ↓ 42.0 126 1

Nested Loop (cost=1,126.42..1,159.81 rows=3 width=50) (actual time=10.387..10.893 rows=126 loops=1)

4. 0.262 10.581 ↓ 7.0 7 1

Bitmap Heap Scan on progagen p1 (cost=1,126.13..1,153.69 rows=1 width=45) (actual time=10.366..10.581 rows=7 loops=1)

  • Recheck Cond: ((fecha_pga = '2019-04-30'::date) AND (codsde_pga = 152))
  • Filter: ((codigo_est = 8) AND (codigo_spc = '999'::numeric) AND ((((COALESCE(agedia_pga, 'N'::character varying))::text = 'S'::text) AND (fecha_pga = CURRENT_DATE)) OR (((COALESCE(agedia_pga, 'N'::character varying))
  • Rows Removed by Filter: 58
  • Heap Blocks: exact=65
5. 0.446 10.319 ↓ 0.0 0 1

BitmapAnd (cost=977.89..977.89 rows=26 width=0) (actual time=10.319..10.319 rows=0 loops=1)

6. 1.240 1.240 ↓ 2.3 8,808 1

Bitmap Index Scan on progagen_fecha_pga (cost=0.00..40.62 rows=3,892 width=0) (actual time=1.239..1.240 rows=8,808 loops=1)

  • Index Cond: (fecha_pga = '2019-04-30'::date)
7. 8.633 8.633 ↓ 1.0 92,440 1

Bitmap Index Scan on progagen_codsde_pga (cost=0.00..937.01 rows=91,410 width=0) (actual time=8.633..8.633 rows=92,440 loops=1)

  • Index Cond: (codsde_pga = 152)
8. 0.224 0.224 ↓ 3.6 18 7

Index Scan using turnos_pkey on turnos tu (cost=0.29..6.07 rows=5 width=17) (actual time=0.012..0.032 rows=18 loops=7)

  • Index Cond: ((codigo_jor = (p1.codigo_jor)::numeric) AND (codigo_tur >= (p1.primer_tur)::numeric) AND (codigo_tur <= (p1.ultimo_tur)::numeric))
9. 1.512 651.672 ↑ 14.0 1 126

Append (cost=0.00..129.30 rows=14 width=38) (actual time=5.171..5.172 rows=1 loops=126)

10. 0.000 0.000 ↓ 0.0 0 126

Seq Scan on cexterna ce (cost=0.00..0.00 rows=1 width=84) (actual time=0.000..0.000 rows=0 loops=126)

  • Filter: ((fecha_cita = '2019-04-30'::date) AND (codigo_est = '8'::numeric) AND (fecha_cita = p1.fecha_pga) AND (codigo_med = p1.codigo_med) AND (consul_pga = p1.consul_pga) AND (codigo_jor = (p1.codigo_jor)::numeric)
11. 0.126 0.126 ↓ 0.0 0 126

Index Scan using cexterna_2008_fecha_cita on cexterna_2008 ce_1 (cost=0.14..2.18 rows=1 width=84) (actual time=0.001..0.001 rows=0 loops=126)

  • Index Cond: (fecha_cita = '2019-04-30'::date)
  • Filter: ((codigo_est = '8'::numeric) AND (fecha_cita = p1.fecha_pga) AND (codigo_med = p1.codigo_med) AND (consul_pga = p1.consul_pga) AND (codigo_jor = (p1.codigo_jor)::numeric) AND (codsde_pga = (p1.codsde_pga)::nu
12. 0.126 0.126 ↓ 0.0 0 126

Index Scan using cexterna_2009_fecha_cita on cexterna_2009 ce_2 (cost=0.14..2.18 rows=1 width=84) (actual time=0.001..0.001 rows=0 loops=126)

  • Index Cond: (fecha_cita = '2019-04-30'::date)
  • Filter: ((codigo_est = '8'::numeric) AND (fecha_cita = p1.fecha_pga) AND (codigo_med = p1.codigo_med) AND (consul_pga = p1.consul_pga) AND (codigo_jor = (p1.codigo_jor)::numeric) AND (codsde_pga = (p1.codsde_pga)::nu
13. 0.252 0.252 ↓ 0.0 0 126

Index Scan using cexterna_2010_fecha_cita on cexterna_2010 ce_3 (cost=0.14..2.18 rows=1 width=84) (actual time=0.002..0.002 rows=0 loops=126)

  • Index Cond: (fecha_cita = '2019-04-30'::date)
  • Filter: ((codigo_est = '8'::numeric) AND (fecha_cita = p1.fecha_pga) AND (codigo_med = p1.codigo_med) AND (consul_pga = p1.consul_pga) AND (codigo_jor = (p1.codigo_jor)::numeric) AND (codsde_pga = (p1.codsde_pga)::nu
14. 0.126 0.126 ↓ 0.0 0 126

Index Scan using cexterna_2011_fecha_cita on cexterna_2011 ce_4 (cost=0.14..2.18 rows=1 width=84) (actual time=0.001..0.001 rows=0 loops=126)

  • Index Cond: (fecha_cita = '2019-04-30'::date)
  • Filter: ((codigo_est = '8'::numeric) AND (fecha_cita = p1.fecha_pga) AND (codigo_med = p1.codigo_med) AND (consul_pga = p1.consul_pga) AND (codigo_jor = (p1.codigo_jor)::numeric) AND (codsde_pga = (p1.codsde_pga)::nu
15. 0.126 0.126 ↓ 0.0 0 126

Index Scan using cexterna_2012_fecha_cita on cexterna_2012 ce_5 (cost=0.14..2.18 rows=1 width=84) (actual time=0.001..0.001 rows=0 loops=126)

  • Index Cond: (fecha_cita = '2019-04-30'::date)
  • Filter: ((codigo_est = '8'::numeric) AND (fecha_cita = p1.fecha_pga) AND (codigo_med = p1.codigo_med) AND (consul_pga = p1.consul_pga) AND (codigo_jor = (p1.codigo_jor)::numeric) AND (codsde_pga = (p1.codsde_pga)::nu
16. 0.126 0.126 ↓ 0.0 0 126

Index Scan using cexterna_2013_fecha_cita on cexterna_2013 ce_6 (cost=0.14..2.18 rows=1 width=84) (actual time=0.001..0.001 rows=0 loops=126)

  • Index Cond: (fecha_cita = '2019-04-30'::date)
  • Filter: ((codigo_est = '8'::numeric) AND (fecha_cita = p1.fecha_pga) AND (codigo_med = p1.codigo_med) AND (consul_pga = p1.consul_pga) AND (codigo_jor = (p1.codigo_jor)::numeric) AND (codsde_pga = (p1.codsde_pga)::nu
17. 0.252 0.252 ↓ 0.0 0 126

Index Scan using cexterna_2014_fecha_cita on cexterna_2014 ce_7 (cost=0.14..2.18 rows=1 width=84) (actual time=0.002..0.002 rows=0 loops=126)

  • Index Cond: (fecha_cita = '2019-04-30'::date)
  • Filter: ((codigo_est = '8'::numeric) AND (fecha_cita = p1.fecha_pga) AND (codigo_med = p1.codigo_med) AND (consul_pga = p1.consul_pga) AND (codigo_jor = (p1.codigo_jor)::numeric) AND (codsde_pga = (p1.codsde_pga)::nu
18. 0.126 0.126 ↓ 0.0 0 126

Index Scan using cexterna_2015_fecha_cita on cexterna_2015 ce_8 (cost=0.14..2.18 rows=1 width=84) (actual time=0.001..0.001 rows=0 loops=126)

  • Index Cond: (fecha_cita = '2019-04-30'::date)
  • Filter: ((codigo_est = '8'::numeric) AND (fecha_cita = p1.fecha_pga) AND (codigo_med = p1.codigo_med) AND (consul_pga = p1.consul_pga) AND (codigo_jor = (p1.codigo_jor)::numeric) AND (codsde_pga = (p1.codsde_pga)::nu
19. 0.126 3.654 ↓ 0.0 0 126

Bitmap Heap Scan on cexterna_2016 ce_9 (cost=37.37..38.41 rows=1 width=38) (actual time=0.029..0.029 rows=0 loops=126)

  • Recheck Cond: ((fecha_cita = p1.fecha_pga) AND (fecha_cita = '2019-04-30'::date) AND (codigo_med = p1.codigo_med))
  • Filter: ((codigo_est = '8'::numeric) AND (consul_pga = p1.consul_pga) AND (codigo_jor = (p1.codigo_jor)::numeric) AND (codsde_pga = (p1.codsde_pga)::numeric))
20. 0.126 3.528 ↓ 0.0 0 126

BitmapAnd (cost=37.37..37.37 rows=1 width=0) (actual time=0.028..0.028 rows=0 loops=126)

21. 0.882 0.882 ↑ 12.5 4 126

Bitmap Index Scan on cexterna_2016_fecha_cita (cost=0.00..1.94 rows=50 width=0) (actual time=0.007..0.007 rows=4 loops=126)

  • Index Cond: ((fecha_cita = p1.fecha_pga) AND (fecha_cita = '2019-04-30'::date))
22. 2.520 2.520 ↑ 36.3 83 126

Bitmap Index Scan on cexterna_2016_codigo_med (cost=0.00..35.19 rows=3,017 width=0) (actual time=0.020..0.020 rows=83 loops=126)

  • Index Cond: (codigo_med = p1.codigo_med)
23. 0.126 73.962 ↓ 0.0 0 126

Bitmap Heap Scan on cexterna_2017 ce_10 (cost=37.55..38.59 rows=1 width=38) (actual time=0.587..0.587 rows=0 loops=126)

  • Recheck Cond: ((fecha_cita = p1.fecha_pga) AND (fecha_cita = '2019-04-30'::date) AND (codigo_med = p1.codigo_med))
  • Filter: ((codigo_est = '8'::numeric) AND (consul_pga = p1.consul_pga) AND (codigo_jor = (p1.codigo_jor)::numeric) AND (codsde_pga = (p1.codsde_pga)::numeric))
24. 0.252 73.836 ↓ 0.0 0 126

BitmapAnd (cost=37.55..37.55 rows=1 width=0) (actual time=0.586..0.586 rows=0 loops=126)

25. 0.882 0.882 ↑ 10.5 6 126

Bitmap Index Scan on cexterna_2017_fecha_cita (cost=0.00..2.07 rows=63 width=0) (actual time=0.007..0.007 rows=6 loops=126)

  • Index Cond: ((fecha_cita = p1.fecha_pga) AND (fecha_cita = '2019-04-30'::date))
26. 72.702 72.702 ↓ 1.3 3,997 126

Bitmap Index Scan on cexterna_2017_codigo_med (cost=0.00..35.23 rows=3,023 width=0) (actual time=0.577..0.577 rows=3,997 loops=126)

  • Index Cond: (codigo_med = p1.codigo_med)
27. 95.256 95.256 ↓ 0.0 0 126

Index Scan using cexterna_2018_fecha_cita on cexterna_2018 ce_11 (cost=0.44..15.25 rows=1 width=39) (actual time=0.756..0.756 rows=0 loops=126)

  • Index Cond: ((fecha_cita = p1.fecha_pga) AND (fecha_cita = '2019-04-30'::date))
  • Filter: ((codigo_est = '8'::numeric) AND (codigo_med = p1.codigo_med) AND (consul_pga = p1.consul_pga) AND (codigo_jor = (p1.codigo_jor)::numeric) AND (codsde_pga = (p1.codsde_pga)::numeric))
  • Rows Removed by Filter: 561
28. 7.560 475.776 ↑ 1.0 1 126

Bitmap Heap Scan on cexterna_2019 ce_12 (cost=16.33..17.37 rows=1 width=38) (actual time=3.776..3.776 rows=1 loops=126)

  • Recheck Cond: ((fecha_cita = p1.fecha_pga) AND (fecha_cita = '2019-04-30'::date) AND (codigo_med = p1.codigo_med))
  • Filter: ((codigo_est = '8'::numeric) AND (consul_pga = p1.consul_pga) AND (codigo_jor = (p1.codigo_jor)::numeric) AND (codsde_pga = (p1.codsde_pga)::numeric))
  • Heap Blocks: exact=72
29. 125.622 468.216 ↓ 0.0 0 126

BitmapAnd (cost=16.33..16.33 rows=1 width=0) (actual time=3.716..3.716 rows=0 loops=126)

30. 299.880 299.880 ↓ 230.3 19,347 126

Bitmap Index Scan on cexterna_2019_fecha_cita (cost=0.00..2.27 rows=84 width=0) (actual time=2.380..2.380 rows=19,347 loops=126)

  • Index Cond: ((fecha_cita = p1.fecha_pga) AND (fecha_cita = '2019-04-30'::date))
31. 42.714 42.714 ↓ 2.0 2,259 126

Bitmap Index Scan on cexterna_2019_codigo_med (cost=0.00..13.81 rows=1,117 width=0) (actual time=0.339..0.339 rows=2,259 loops=126)

  • Index Cond: (codigo_med = p1.codigo_med)
32. 0.252 0.252 ↓ 0.0 0 126

Index Scan using cexterna_2020_fecha_cita on cexterna_2020 ce_13 (cost=0.14..2.18 rows=1 width=84) (actual time=0.002..0.002 rows=0 loops=126)

  • Index Cond: (fecha_cita = '2019-04-30'::date)
  • Filter: ((codigo_est = '8'::numeric) AND (fecha_cita = p1.fecha_pga) AND (codigo_med = p1.codigo_med) AND (consul_pga = p1.consul_pga) AND (codigo_jor = (p1.codigo_jor)::numeric) AND (codsde_pga = (p1.codsde_pga)::nu
Planning time : 7.097 ms
Execution time : 663.866 ms