explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4OJB

Settings
# exclusive inclusive rows x rows loops node
1. 0.161 37,174.214 ↑ 3.0 1 1

Sort (cost=2,326.88..2,326.88 rows=3 width=12) (actual time=37,174.214..37,174.214 rows=1 loops=1)

  • Sort Key: ((sum(CASE WHEN ((s."group")::text = 'TRK'::text) THEN s.reg_tru ELSE NULL::integer END) + (sum(CASE WHEN ((s."group")::text = 'TRNK2'::text) THEN s.reg_tru2 ELSE NULL::integer END) * 65536)))
  • Sort Method: quicksort Memory: 25kB
2. 10.567 37,174.053 ↑ 3.0 1 1

GroupAggregate (cost=0.41..2,326.85 rows=3 width=12) (actual time=37,174.052..37,174.053 rows=1 loops=1)

  • Group Key: (date(s.sample_hour))
3. 4.597 37,163.486 ↓ 11,348.7 34,046 1

Append (cost=0.41..2,326.76 rows=3 width=94) (actual time=19,091.549..37,163.486 rows=34,046 loops=1)

4. 1,984.608 1,984.608 ↓ 0.0 0 1

Index Scan using sample_2019_07_phnfazwods0_switch_name_sample_hour_group_ke_idx on sample_2019_07_phnfazwods0 s (cost=0.41..301.40 rows=1 width=94) (actual time=1,984.608..1,984.608 rows=0 loops=1)

  • Index Cond: (((switch_name)::text = 'PHNFAZWODS0'::text) AND (("group")::text = ANY ('{TRK,TRNK2}'::text[])))
  • Filter: ((date(sample_hour) >= '2019-08-27'::date) AND (date(sample_hour) <= '2019-09-25'::date) AND (date(sample_hour) = '2019-09-19'::date))
  • Rows Removed by Filter: 184,004
5. 6,336.622 6,336.622 ↓ 0.0 0 1

Index Scan using sample_2019_08_phnfazwods0_switch_name_sample_hour_group_ke_idx on sample_2019_08_phnfazwods0 s_1 (cost=0.55..1,012.75 rows=1 width=94) (actual time=6,336.621..6,336.622 rows=0 loops=1)

  • Index Cond: (((switch_name)::text = 'PHNFAZWODS0'::text) AND (("group")::text = ANY ('{TRK,TRNK2}'::text[])))
  • Filter: ((date(sample_hour) >= '2019-08-27'::date) AND (date(sample_hour) <= '2019-09-25'::date) AND (date(sample_hour) = '2019-09-19'::date))
  • Rows Removed by Filter: 630,156
6. 28,837.659 28,837.659 ↓ 34,046.0 34,046 1

Index Scan using sample_2019_09_phnfazwods0_switch_name_sample_hour_group_ke_idx on sample_2019_09_phnfazwods0 s_2 (cost=0.55..1,012.59 rows=1 width=94) (actual time=10,770.310..28,837.659 rows=34,046 loops=1)

  • Index Cond: (((switch_name)::text = 'PHNFAZWODS0'::text) AND (("group")::text = ANY ('{TRK,TRNK2}'::text[])))
  • Filter: ((date(sample_hour) >= '2019-08-27'::date) AND (date(sample_hour) <= '2019-09-25'::date) AND (date(sample_hour) = '2019-09-19'::date))
  • Rows Removed by Filter: 589,348