explain.depesz.com

A tool for finding a real cause for slow queries.

Result: lB

options
exclusive inclusive rows x rows loops node
0.189 136.112 ↓ 4.0 4 1

GroupAggregate (cost=257.62..316.09 rows=1 width=180) (actual time=135.885..136.112 rows=4 loops=1)

1.343 135.923 ↓ 64.0 64 1

Sort (cost=257.62..257.62 rows=1 width=180) (actual time=135.822..135.923 rows=64 loops=1)

  • Sort Key: date_part('year'::text, ('1969-12-31 21:00:00-03'::timestamp with time zone + ((cd.cal_start)::double precision * '00:00:01'::interval))), date_part('month'::text, ('1969-12-31 21:00:00-03'::timestamp with time zone + ((cd.cal_start)::double precision * '00:00:01'::interval))), r.name, (subplan), cu.cal_user_id, c.cal_title
1.379 134.580 ↓ 64.0 64 1

Nested Loop (cost=40.72..257.61 rows=1 width=180) (actual time=91.067..134.580 rows=64 loops=1)

2.797 131.857 ↓ 64.0 64 1

Nested Loop (cost=40.72..190.89 rows=1 width=145) (actual time=90.951..131.857 rows=64 loops=1)

6.462 127.492 ↓ 196.0 196 1

Nested Loop (cost=32.44..166.02 rows=1 width=132) (actual time=33.022..127.492 rows=196 loops=1)

  • Join Filter: ((r.res_id)::text = (cr.cal_user_id)::text)
52.726 82.418 ↓ 196.0 196 1

Nested Loop (cost=32.44..110.02 rows=1 width=33) (actual time=32.927..82.418 rows=196 loops=1)

6.542 10.337 ↓ 1290.3 3871 1

Bitmap Heap Scan on egw_cal_dates cd (cost=24.16..35.42 rows=3 width=20) (actual time=3.834..10.337 rows=3871 loops=1)

  • Recheck Cond: ((date_part('year'::text, ('1970-01-01 00:00:00'::timestamp without time zone + ((cal_start)::double precision * '00:00:01'::interval))) = 2008::double precision) AND (date_part('month'::text, ('1970-01-01 00:00:00'::timestamp without time zone + ((cal_start)::double precision * '00:00:01'::interval))) = ANY ('{10,11,12}'::double precision[])))
0.034 3.795 ↓ 0.0 0 1

BitmapAnd (cost=24.16..24.16 rows=3 width=0) (actual time=3.795..3.795 rows=0 loops=1)

1.972 1.972 ↓ 61.4 14118 1

Bitmap Index Scan on idx_egw_0002 (cost=0.00..5.99 rows=230 width=0) (actual time=1.972..1.972 rows=14118 loops=1)

  • Index Cond: (date_part('year'::text, ('1970-01-01 00:00:00'::timestamp without time zone + ((cal_start)::double precision * '00:00:01'::interval))) = 2008::double precision)
1.789 1.789 ↓ 18.6 12799 1

Bitmap Index Scan on idx_egw_0006 (cost=0.00..17.92 rows=687 width=0) (actual time=1.789..1.789 rows=12799 loops=1)

  • Index Cond: (date_part('month'::text, ('1970-01-01 00:00:00'::timestamp without time zone + ((cal_start)::double precision * '00:00:01'::interval))) = ANY ('{10,11,12}'::double precision[]))
0.000 19.355 ↓ 0.0 0 3871

Index Scan using egw_cal_user_pkey on egw_cal_user cr (cost=8.28..16.57 rows=1 width=21) (actual time=0.005..0.005 rows=0 loops=3871)

  • Index Cond: ((cd.cal_id = cr.cal_id) AND (cr.cal_recur_date = COALESCE((subplan), 0::bigint)) AND ((cr.cal_user_type)::text = 'r'::text))
         

SubPlan (forIndex Scan)

23.226 23.226 ↑ 1.0 1 3871

Index Scan using egw_cal_dates_pkey on egw_cal_dates icd (cost=0.00..8.28 rows=1 width=0) (actual time=0.005..0.006 rows=1 loops=3871)

  • Index Cond: ((cal_id = $2) AND (cal_start = $1))
  • Filter: (cal_start <> 0)
0.000 0.000 ↓ 0.0 0

Index Scan using egw_cal_dates_pkey on egw_cal_dates icd (cost=0.00..8.28 rows=1 width=0) (actual time=.. rows= loops=0)

  • Index Cond: ((cal_id = $2) AND (cal_start = $1))
  • Filter: (cal_start <> 0)
17.640 38.612 ↑ 1.0 13 196

Nested Loop (cost=0.00..55.80 rows=13 width=112) (actual time=0.013..0.197 rows=13 loops=196)

6.272 6.272 ↓ 5.0 15 196

Index Scan using idx_egw_0003 on egw_categories ct (cost=0.00..13.16 rows=3 width=4) (actual time=0.004..0.032 rows=15 loops=196)

  • Index Cond: (cat_main = 133)
14.700 14.700 ↑ 11.0 1 2940

Index Scan using idx_egw_0004 on egw_resources r (cost=0.00..14.08 rows=11 width=116) (actual time=0.003..0.005 rows=1 loops=2940)

  • Index Cond: (ct.cat_id = r.cat_id)
0.196 1.568 ↓ 0.0 0 196

Index Scan using egw_cal_user_pkey on egw_cal_user cu (cost=8.28..16.58 rows=1 width=21) (actual time=0.007..0.008 rows=0 loops=196)

  • Index Cond: ((cu.cal_id = cr.cal_id) AND (cu.cal_recur_date = COALESCE((subplan), 0::bigint)) AND ((cu.cal_user_type)::text = 'u'::text) AND ((cu.cal_user_id)::text = '278827'::text))
         

SubPlan (forIndex Scan)

1.372 1.372 ↑ 1.0 1 196

Index Scan using egw_cal_dates_pkey on egw_cal_dates icd (cost=0.00..8.28 rows=1 width=0) (actual time=0.005..0.007 rows=1 loops=196)

  • Index Cond: ((cal_id = $2) AND (cal_start = $1))
  • Filter: (cal_start <> 0)
0.000 0.000 ↓ 0.0 0

Index Scan using egw_cal_dates_pkey on egw_cal_dates icd (cost=0.00..8.28 rows=1 width=0) (actual time=.. rows= loops=0)

  • Index Cond: ((cal_id = $2) AND (cal_start = $1))
  • Filter: (cal_start <> 0)
0.384 0.384 ↑ 1.0 1 64

Index Scan using egw_cal_pkey on egw_cal c (cost=0.00..8.27 rows=1 width=51) (actual time=0.004..0.006 rows=1 loops=64)

  • Index Cond: (c.cal_id = cd.cal_id)
         

SubPlan (forNested Loop)

0.448 0.960 ↑ 10.0 1 64

Bitmap Heap Scan on egw_categories ca (cost=30.59..58.41 rows=10 width=50) (actual time=0.013..0.015 rows=1 loops=64)

  • Recheck Cond: ((cat_id)::text = ANY (string_to_array(($0)::text, ','::text)))
0.512 0.512 ↑ 10.0 1 64

Bitmap Index Scan on idx_egw_0005 (cost=0.00..30.59 rows=10 width=0) (actual time=0.008..0.008 rows=1 loops=64)

  • Index Cond: ((cat_id)::text = ANY (string_to_array(($0)::text, ','::text)))