explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BUqJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 352.334 ↑ 9.4 270 1

---------------------------- GroupAggregate (cost=26,024.55..26,100.69 rows=2,538 width=67) (actual time=351.558..352.334 rows=270 loops=1)

  • Group Key: cexterna.codigo_jor, cexterna.fecha_cita, cexterna.codigo_med, cexterna.consul_pga
  • Planning time: 3304.817 ms
  • Execution time: 352.926 ms
2. 1.862 351.495 ↑ 2.0 1,278 1

Sort (cost=26,024.55..26,030.89 rows=2,538 width=31) (actual time=351.406..351.495 rows=1,278 loops=1)

  • Sort Key: cexterna.codigo_jor, cexterna.codigo_med, cexterna.consul_pga
  • Sort Method: quicksort Memory: 148kB
3. 0.217 349.633 ↑ 2.0 1,278 1

Result (cost=0.00..25,881.03 rows=2,538 width=31) (actual time=46.330..349.633 rows=1,278 loops=1)

4. 60.955 349.416 ↑ 2.0 1,278 1

Append (cost=0.00..25,855.65 rows=2,538 width=31) (actual time=46.329..349.416 rows=1,278 loops=1)

  • -> Index Scan using cexterna_2018_fecha_cita on cexterna_2018 (cost=0.44..5883.35 rows=630 width=25) (actual time=0.492..60.782 rows=572 loop
5. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on cexterna (cost=0.00..0.00 rows=1 width=56) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (((codsde_pga = '374'::numeric) OR (codini_cex IS NOT NULL)) AND (codigo_est = '8'::numeric) AND (fecha_cita = '2019-01-11'::date
6. 0.001 0.012 ↓ 0.0 0 1

Bitmap Heap Scan on cexterna_2008 (cost=55.76..73.05 rows=14 width=33) (actual time=0.012..0.012 rows=0 loops=1)

  • Recheck Cond: ((fecha_cita = '2019-01-11'::date) AND ((codsde_pga = '374'::numeric) OR (codini_cex IS NOT NULL)))
  • Filter: (codigo_est = '8'::numeric)
7. 0.000 0.011 ↓ 0.0 0 1

BitmapAnd (cost=55.76..55.76 rows=17 width=0) (actual time=0.011..0.011 rows=0 loops=1)

8. 0.011 0.011 ↓ 0.0 0 1

Bitmap Index Scan on cexterna_2008_fecha_cita (cost=0.00..18.16 rows=1,698 width=0) (actual time=0.011..0.011 rows=0 loops=1)

  • Index Cond: (fecha_cita = '2019-01-11'::date)
9. 0.000 0.000 ↓ 0.0 0

BitmapOr (cost=37.34..37.34 rows=3,399 width=0) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on cexterna_2008_codsde_pga (cost=0.00..13.33 rows=1,188 width=0) (never executed)

  • Index Cond: (codsde_pga = '374'::numeric)
11. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on cexterna_2008_codini_cex (cost=0.00..24.00 rows=2,211 width=0) (never executed)

  • Index Cond: (codini_cex IS NOT NULL)
12. 0.001 4.218 ↓ 0.0 0 1

Bitmap Heap Scan on cexterna_2009 (cost=672.60..782.49 rows=90 width=33) (actual time=4.218..4.218 rows=0 loops=1)

  • Recheck Cond: ((fecha_cita = '2019-01-11'::date) AND ((codsde_pga = '374'::numeric) OR (codini_cex IS NOT NULL)))
  • Filter: (codigo_est = '8'::numeric)
13. 0.001 4.217 ↓ 0.0 0 1

BitmapAnd (cost=672.60..672.60 rows=108 width=0) (actual time=4.217..4.217 rows=0 loops=1)

14. 0.011 0.011 ↑ 8,009.0 1 1

Bitmap Index Scan on cexterna_2009_fecha_cita (cost=0.00..82.50 rows=8,009 width=0) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: (fecha_cita = '2019-01-11'::date)
15. 4.205 4.205 ↓ 0.0 0 1

BitmapOr (cost=589.83..589.83 rows=57,322 width=0) (actual time=4.205..4.205 rows=0 loops=1)

  • -> Bitmap Index Scan on cexterna_2009_codsde_pga (cost=0.00..147.98 rows=14340 width=0) (actual time=0.028..0.028 rows=47 l
  • Index Cond: (codsde_pga = '374'::numeric)
  • -> Bitmap Index Scan on cexterna_2009_codini_cex (cost=0.00..441.80 rows=42982 width=0) (actual time=4.176..4.176 rows=4103
  • Index Cond: (codini_cex IS NOT NULL)
16. 0.003 5.844 ↓ 0.0 0 1

Bitmap Heap Scan on cexterna_2010 (cost=941.43..1,086.93 rows=118 width=33) (actual time=5.844..5.844 rows=0 loops=1)

  • Recheck Cond: ((fecha_cita = '2019-01-11'::date) AND ((codsde_pga = '374'::numeric) OR (codini_cex IS NOT NULL)))
  • Filter: (codigo_est = '8'::numeric)
17. 0.003 5.841 ↓ 0.0 0 1

BitmapAnd (cost=941.43..941.43 rows=143 width=0) (actual time=5.841..5.841 rows=0 loops=1)

18. 0.015 0.015 ↑ 4,732.0 2 1

Bitmap Index Scan on cexterna_2010_fecha_cita (cost=0.00..97.41 rows=9,464 width=0) (actual time=0.015..0.015 rows=2 loops=1)

  • Index Cond: (fecha_cita = '2019-01-11'::date)
19. 5.823 5.823 ↓ 0.0 0 1

BitmapOr (cost=843.73..843.73 rows=82,107 width=0) (actual time=5.823..5.823 rows=0 loops=1)

  • -> Bitmap Index Scan on cexterna_2010_codsde_pga (cost=0.00..178.94 rows=17401 width=0) (actual time=0.025..0.025 rows=29 l
  • Index Cond: (codsde_pga = '374'::numeric)
  • -> Bitmap Index Scan on cexterna_2010_codini_cex (cost=0.00..664.74 rows=64707 width=0) (actual time=5.797..5.797 rows=6359
  • Index Cond: (codini_cex IS NOT NULL)
20. 0.001 4.814 ↓ 0.0 0 1

Bitmap Heap Scan on cexterna_2011 (cost=894.87..1,024.09 rows=102 width=33) (actual time=4.814..4.814 rows=0 loops=1)

  • Recheck Cond: ((fecha_cita = '2019-01-11'::date) AND ((codsde_pga = '374'::numeric) OR (codini_cex IS NOT NULL)))
  • Filter: (codigo_est = '8'::numeric)
21. 0.001 4.813 ↓ 0.0 0 1

BitmapAnd (cost=894.87..894.87 rows=127 width=0) (actual time=4.813..4.813 rows=0 loops=1)

22. 0.016 0.016 ↑ 10,435.0 1 1

Bitmap Index Scan on cexterna_2011_fecha_cita (cost=0.00..107.70 rows=10,435 width=0) (actual time=0.016..0.016 rows=1 loops=1)

  • Index Cond: (fecha_cita = '2019-01-11'::date)
23. 4.796 4.796 ↓ 0.0 0 1

BitmapOr (cost=786.90..786.90 rows=76,531 width=0) (actual time=4.796..4.796 rows=0 loops=1)

  • -> Bitmap Index Scan on cexterna_2011_codsde_pga (cost=0.00..244.62 rows=23758 width=0) (actual time=0.029..0.029 rows=11 l
  • Index Cond: (codsde_pga = '374'::numeric)
  • -> Bitmap Index Scan on cexterna_2011_codini_cex (cost=0.00..542.23 rows=52773 width=0) (actual time=4.767..4.767 rows=5428
  • Index Cond: (codini_cex IS NOT NULL)
24. 0.004 4.929 ↓ 0.0 0 1

Bitmap Heap Scan on cexterna_2012 (cost=1,097.00..1,258.78 rows=128 width=33) (actual time=4.929..4.929 rows=0 loops=1)

  • Recheck Cond: ((fecha_cita = '2019-01-11'::date) AND ((codsde_pga = '374'::numeric) OR (codini_cex IS NOT NULL)))
  • Filter: (codigo_est = '8'::numeric)
25. 0.003 4.925 ↓ 0.0 0 1

BitmapAnd (cost=1,097.00..1,097.00 rows=159 width=0) (actual time=4.925..4.925 rows=0 loops=1)

26. 0.019 0.019 ↑ 4,110.3 3 1

Bitmap Index Scan on cexterna_2012_fecha_cita (cost=0.00..126.92 rows=12,331 width=0) (actual time=0.019..0.019 rows=3 loops=1)

  • Index Cond: (fecha_cita = '2019-01-11'::date)
27. 4.903 4.903 ↓ 0.0 0 1

BitmapOr (cost=969.80..969.80 rows=94,383 width=0) (actual time=4.903..4.903 rows=0 loops=1)

  • -> Bitmap Index Scan on cexterna_2012_codsde_pga (cost=0.00..271.49 rows=26408 width=0) (actual time=0.027..0.027 rows=38 l
  • Index Cond: (codsde_pga = '374'::numeric)
  • -> Bitmap Index Scan on cexterna_2012_codini_cex (cost=0.00..698.25 rows=67975 width=0) (actual time=4.876..4.876 rows=6111
  • Index Cond: (codini_cex IS NOT NULL)
28. 0.001 0.018 ↓ 0.0 0 1

Bitmap Heap Scan on cexterna_2013 (cost=1,144.45..1,305.22 rows=125 width=33) (actual time=0.018..0.018 rows=0 loops=1)

  • Recheck Cond: ((fecha_cita = '2019-01-11'::date) AND ((codsde_pga = '374'::numeric) OR (codini_cex IS NOT NULL)))
  • Filter: (codigo_est = '8'::numeric)
29. 0.001 0.017 ↓ 0.0 0 1

BitmapAnd (cost=1,144.45..1,144.45 rows=158 width=0) (actual time=0.017..0.017 rows=0 loops=1)

30. 0.016 0.016 ↓ 0.0 0 1

Bitmap Index Scan on cexterna_2013_fecha_cita (cost=0.00..144.83 rows=14,053 width=0) (actual time=0.016..0.016 rows=0 loops=1)

  • Index Cond: (fecha_cita = '2019-01-11'::date)
31. 0.000 0.000 ↓ 0.0 0

BitmapOr (cost=999.34..999.34 rows=97,255 width=0) (never executed)

32. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on cexterna_2013_codsde_pga (cost=0.00..292.92 rows=28,465 width=0) (never executed)

  • Index Cond: (codsde_pga = '374'::numeric)
33. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on cexterna_2013_codini_cex (cost=0.00..706.35 rows=68,789 width=0) (never executed)

  • Index Cond: (codini_cex IS NOT NULL)
34. 0.001 5.990 ↓ 0.0 0 1

Bitmap Heap Scan on cexterna_2014 (cost=1,291.90..1,459.78 rows=127 width=33) (actual time=5.990..5.990 rows=0 loops=1)

  • Recheck Cond: ((fecha_cita = '2019-01-11'::date) AND ((codsde_pga = '374'::numeric) OR (codini_cex IS NOT NULL)))
  • Filter: (codigo_est = '8'::numeric)
35. 0.004 5.989 ↓ 0.0 0 1

BitmapAnd (cost=1,291.90..1,291.90 rows=165 width=0) (actual time=5.989..5.989 rows=0 loops=1)

36. 0.018 0.018 ↑ 3,911.5 4 1

Bitmap Index Scan on cexterna_2014_fecha_cita (cost=0.00..160.78 rows=15,646 width=0) (actual time=0.018..0.018 rows=4 loops=1)

  • Index Cond: (fecha_cita = '2019-01-11'::date)
37. 5.967 5.967 ↓ 0.0 0 1

BitmapOr (cost=1,130.83..1,130.83 rows=110,120 width=0) (actual time=5.967..5.967 rows=0 loops=1)

  • -> Bitmap Index Scan on cexterna_2014_codsde_pga (cost=0.00..368.67 rows=35898 width=0) (actual time=0.020..0.020 rows=23 l
  • Index Cond: (codsde_pga = '374'::numeric)
  • -> Bitmap Index Scan on cexterna_2014_codini_cex (cost=0.00..762.10 rows=74222 width=0) (actual time=5.946..5.946 rows=7485
  • Index Cond: (codini_cex IS NOT NULL)
38. 0.022 20.500 ↑ 251.0 1 1

Bitmap Heap Scan on cexterna_2015 (cost=2,484.23..2,823.06 rows=251 width=33) (actual time=20.499..20.500 rows=1 loops=1)

  • Recheck Cond: ((fecha_cita = '2019-01-11'::date) AND ((codsde_pga = '374'::numeric) OR (codini_cex IS NOT NULL)))
  • Filter: (codigo_est = '8'::numeric)
  • Heap Blocks: exact=1
39. 0.004 20.478 ↓ 0.0 0 1

BitmapAnd (cost=2,484.23..2,484.23 rows=333 width=0) (actual time=20.478..20.478 rows=0 loops=1)

40. 0.018 0.018 ↑ 2,119.6 9 1

Bitmap Index Scan on cexterna_2015_fecha_cita (cost=0.00..196.50 rows=19,076 width=0) (actual time=0.018..0.018 rows=9 loops=1)

  • Index Cond: (fecha_cita = '2019-01-11'::date)
41. 20.456 20.456 ↓ 0.0 0 1

BitmapOr (cost=2,287.41..2,287.41 rows=223,122 width=0) (actual time=20.456..20.456 rows=0 loops=1)

  • -> Bitmap Index Scan on cexterna_2015_codsde_pga (cost=0.00..1243.60 rows=121355 width=0) (actual time=13.683..13.683 rows=
  • Index Cond: (codsde_pga = '374'::numeric)
  • -> Bitmap Index Scan on cexterna_2015_codini_cex (cost=0.00..1043.69 rows=101767 width=0) (actual time=6.770..6.770 rows=96
  • Index Cond: (codini_cex IS NOT NULL)
42. 0.002 53.118 ↓ 0.0 0 1

Bitmap Heap Scan on cexterna_2016 (cost=4,472.44..5,125.68 rows=465 width=33) (actual time=53.118..53.118 rows=0 loops=1)

  • Recheck Cond: ((fecha_cita = '2019-01-11'::date) AND ((codsde_pga = '374'::numeric) OR (codini_cex IS NOT NULL)))
  • Filter: (codigo_est = '8'::numeric)
43. 0.188 53.116 ↓ 0.0 0 1

BitmapAnd (cost=4,472.44..4,472.44 rows=642 width=0) (actual time=53.116..53.116 rows=0 loops=1)

  • -> Bitmap Index Scan on cexterna_2016_fecha_cita (cost=0.00..263.48 rows=25606 width=0) (actual time=0.018..0.018 rows=13 loops=1
  • Index Cond: (fecha_cita = '2019-01-11'::date)
44. 52.928 52.928 ↓ 0.0 0 1

BitmapOr (cost=4,208.59..4,208.59 rows=410,598 width=0) (actual time=52.928..52.928 rows=0 loops=1)

  • -> Bitmap Index Scan on cexterna_2016_codsde_pga (cost=0.00..3087.91 rows=301397 width=0) (actual time=36.145..36.145 rows=
  • Index Cond: (codsde_pga = '374'::numeric)
  • -> Bitmap Index Scan on cexterna_2016_codini_cex (cost=0.00..1120.45 rows=109202 width=0) (actual time=16.781..16.781 rows=
  • Index Cond: (codini_cex IS NOT NULL)
45. 0.019 89.902 ↑ 478.0 1 1

Bitmap Heap Scan on cexterna_2017 (cost=4,319.38..4,984.82 rows=478 width=33) (actual time=89.902..89.902 rows=1 loops=1)

  • Recheck Cond: ((fecha_cita = '2019-01-11'::date) AND ((codsde_pga = '374'::numeric) OR (codini_cex IS NOT NULL)))
  • Filter: (codigo_est = '8'::numeric)
  • Heap Blocks: exact=1
  • Index Cond: (fecha_cita = '2019-01-11'::date)
  • Filter: (((codsde_pga = '374'::numeric) OR (codini_cex IS NOT NULL)) AND (codigo_est = '8'::numeric))
  • Rows Removed by Filter: 18430
46. 0.318 89.883 ↓ 0.0 0 1

BitmapAnd (cost=4,319.38..4,319.38 rows=654 width=0) (actual time=89.883..89.883 rows=0 loops=1)

  • -> Bitmap Index Scan on cexterna_2017_fecha_cita (cost=0.00..309.91 rows=30196 width=0) (actual time=0.028..0.028 rows=21 loops=1
  • Index Cond: (fecha_cita = '2019-01-11'::date)
47. 89.565 89.565 ↓ 0.0 0 1

BitmapOr (cost=4,009.10..4,009.10 rows=391,198 width=0) (actual time=89.565..89.565 rows=0 loops=1)

  • -> Bitmap Index Scan on cexterna_2017_codsde_pga (cost=0.00..2947.05 rows=287681 width=0) (actual time=68.845..68.845 rows=
  • Index Cond: (codsde_pga = '374'::numeric)
  • -> Bitmap Index Scan on cexterna_2017_codini_cex (cost=0.00..1061.82 rows=103517 width=0) (actual time=20.719..20.719 rows=
  • Index Cond: (codini_cex IS NOT NULL)
48. 47.182 99.102 ↓ 88.0 704 1

Bitmap Heap Scan on cexterna_2019 (cost=38.10..46.24 rows=8 width=56) (actual time=53.741..99.102 rows=704 loops=1)

  • Recheck Cond: ((fecha_cita = '2019-01-11'::date) AND (codigo_est = '8'::numeric))
  • Filter: ((codsde_pga = '374'::numeric) OR (codini_cex IS NOT NULL))
  • Rows Removed by Filter: 18038
  • Heap Blocks: exact=10827
49. 51.920 51.920 ↓ 0.0 0 1

BitmapAnd (cost=38.10..38.10 rows=8 width=0) (actual time=51.920..51.920 rows=0 loops=1)

  • -> Bitmap Index Scan on cexterna_2019_fecha_cita (cost=0.00..18.92 rows=1667 width=0) (actual time=2.847..2.847 rows=21787 loops=
  • Index Cond: (fecha_cita = '2019-01-11'::date)
  • -> Bitmap Index Scan on cexterna_2019_codigo_est (cost=0.00..18.92 rows=1667 width=0) (actual time=39.851..39.851 rows=366095 loo
  • Index Cond: (codigo_est = '8'::numeric)
50. 0.013 0.013 ↓ 0.0 0 1

Index Scan using cexterna_2020_fecha_cita on cexterna_2020 (cost=0.14..2.17 rows=1 width=56) (actual time=0.013..0.013 rows=0 loops=1)

  • Index Cond: (fecha_cita = '2019-01-11'::date)
  • Filter: (((codsde_pga = '374'::numeric) OR (codini_cex IS NOT NULL)) AND (codigo_est = '8'::numeric))
51. 0.158 55.012 ↑ 11.4 71 1

Sort (cost=146.63..148.65 rows=808 width=138) (actual time=55.009..55.012 rows=71 loops=1)

  • Sort Key: n.nspname, p.proname, (pg_get_function_arguments(p.oid))
  • Sort Method: quicksort Memory: 43kB
52. 1.378 54.854 ↑ 11.4 71 1

Hash Join (cost=1.14..107.61 rows=808 width=138) (actual time=42.495..54.854 rows=71 loops=1)

  • Hash Cond: (p.pronamespace = n.oid)
53. 53.465 53.465 ↓ 3.0 2,402 1

Seq Scan on pg_proc p (cost=0.00..89.30 rows=808 width=78) (actual time=0.052..53.465 rows=2,402 loops=1)

  • Filter: pg_function_is_visible(oid)
54. 0.004 0.011 ↑ 1.0 4 1

Hash (cost=1.09..1.09 rows=4 width=68) (actual time=0.011..0.011 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
55. 0.007 0.007 ↑ 1.0 4 1

Seq Scan on pg_namespace n (cost=0.00..1.09 rows=4 width=68) (actual time=0.005..0.007 rows=4 loops=1)

  • Filter: ((nspname <> 'pg_catalog'::name) AND (nspname <> 'information_schema'::name))