explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kGA

Settings
# exclusive inclusive rows x rows loops node
1. 1.129 50,996.751 ↑ 972.5 4 1

HashAggregate (cost=4,036,872.99..4,036,941.06 rows=3,890 width=64) (actual time=50,996.718..50,996.751 rows=4 loops=1)

  • Group Key: to_char((k.stats_time + '01:00:00'::interval), 'YYYY-MM-DD'::text)
2. 2.430 50,995.622 ↑ 749.0 2,108 1

Result (cost=0.00..4,028,978.98 rows=1,578,801 width=37) (actual time=50,964.527..50,995.622 rows=2,108 loops=1)

3. 1.232 50,993.192 ↑ 749.0 2,108 1

Append (cost=0.00..4,005,296.97 rows=1,578,801 width=13) (actual time=50,964.506..50,993.192 rows=2,108 loops=1)

4. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on kinetic_stats k (cost=0.00..0.00 rows=1 width=40) (actual time=0.003..0.003 rows=0 loops=1)

  • Filter: (((granularity)::text = 'HOUR'::text) AND ((identifier_class)::text = 'SERVICE'::text) AND (((stats_time >= (('now'::cstring)::date - '97:00:00'::interval)) AND (stats_time <= (now() - '97:00:01'::interval))) OR ((stats_time >= (('now'::cstring)::date - '73:00:00'::interval)) AND (stats_time <= (now() - '73:00:01'::interval))) OR ((stats_time >= (('now'::cstring)::date - '49:00:00'::interval)) AND (stats_time <= (now() - '49:00:01'::interval))) OR ((stats_time >= (('now'::cstring)::date - '25:00:00'::interval)) AND (stats_time <= (now() - '25:00:01'::interval)))))
5. 2,020.198 2,033.158 ↓ 0.0 0 1

Bitmap Heap Scan on kinetic_stats_2016_p k_1 (cost=1,114.06..13,456.88 rows=2,328 width=11) (actual time=2,033.158..2,033.158 rows=0 loops=1)

  • Recheck Cond: ((granularity)::text = 'HOUR'::text)
  • Filter: (((identifier_class)::text = 'SERVICE'::text) AND (((stats_time >= (('now'::cstring)::date - '97:00:00'::interval)) AND (stats_time <= (now() - '97:00:01'::interval))) OR ((stats_time >= (('now'::cstring)::date - '73:00:00'::interval)) AND (stats_time <= (now() - '73:00:01'::interval))) OR ((stats_time >= (('now'::cstring)::date - '49:00:00'::interval)) AND (stats_time <= (now() - '49:00:01'::interval))) OR ((stats_time >= (('now'::cstring)::date - '25:00:00'::interval)) AND (stats_time <= (now() - '25:00:01'::interval)))))
  • Rows Removed by Filter: 46723
  • Heap Blocks: exact=6322
6. 12.960 12.960 ↑ 1.0 46,723 1

Bitmap Index Scan on kinetic_stats_2016_p_stats_time_granularity_identifier_id_idx (cost=0.00..1,113.47 rows=46,845 width=0) (actual time=12.960..12.960 rows=46,723 loops=1)

  • Index Cond: ((granularity)::text = 'HOUR'::text)
7. 1,820.106 1,820.106 ↓ 0.0 0 1

Seq Scan on kinetic_stats_2017_p k_2 (cost=0.00..109,271.69 rows=104,563 width=12) (actual time=1,820.105..1,820.106 rows=0 loops=1)

  • Filter: (((granularity)::text = 'HOUR'::text) AND ((identifier_class)::text = 'SERVICE'::text) AND (((stats_time >= (('now'::cstring)::date - '97:00:00'::interval)) AND (stats_time <= (now() - '97:00:01'::interval))) OR ((stats_time >= (('now'::cstring)::date - '73:00:00'::interval)) AND (stats_time <= (now() - '73:00:01'::interval))) OR ((stats_time >= (('now'::cstring)::date - '49:00:00'::interval)) AND (stats_time <= (now() - '49:00:01'::interval))) OR ((stats_time >= (('now'::cstring)::date - '25:00:00'::interval)) AND (stats_time <= (now() - '25:00:01'::interval)))))
  • Rows Removed by Filter: 487714
8. 5,893.081 5,893.081 ↓ 0.0 0 1

Seq Scan on kinetic_stats_2018_p k_3 (cost=0.00..358,602.51 rows=314,988 width=12) (actual time=5,893.081..5,893.081 rows=0 loops=1)

  • Filter: (((granularity)::text = 'HOUR'::text) AND ((identifier_class)::text = 'SERVICE'::text) AND (((stats_time >= (('now'::cstring)::date - '97:00:00'::interval)) AND (stats_time <= (now() - '97:00:01'::interval))) OR ((stats_time >= (('now'::cstring)::date - '73:00:00'::interval)) AND (stats_time <= (now() - '73:00:01'::interval))) OR ((stats_time >= (('now'::cstring)::date - '49:00:00'::interval)) AND (stats_time <= (now() - '49:00:01'::interval))) OR ((stats_time >= (('now'::cstring)::date - '25:00:00'::interval)) AND (stats_time <= (now() - '25:00:01'::interval)))))
  • Rows Removed by Filter: 1580406
9. 40,327.743 41,245.612 ↑ 548.8 2,108 1

Bitmap Heap Scan on kinetic_stats_current k_4 (cost=116,979.48..3,516,071.88 rows=1,156,921 width=13) (actual time=41,218.147..41,245.612 rows=2,108 loops=1)

  • Recheck Cond: ((granularity)::text = 'HOUR'::text)
  • Rows Removed by Index Recheck: 10612
  • Filter: (((identifier_class)::text = 'SERVICE'::text) AND (((stats_time >= (('now'::cstring)::date - '97:00:00'::interval)) AND (stats_time <= (now() - '97:00:01'::interval))) OR ((stats_time >= (('now'::cstring)::date - '73:00:00'::interval)) AND (stats_time <= (now() - '73:00:01'::interval))) OR ((stats_time >= (('now'::cstring)::date - '49:00:00'::interval)) AND (stats_time <= (now() - '49:00:01'::interval))) OR ((stats_time >= (('now'::cstring)::date - '25:00:00'::interval)) AND (stats_time <= (now() - '25:00:01'::interval)))))
  • Rows Removed by Filter: 799663
  • Heap Blocks: exact=85664 lossy=87414
10. 917.869 917.869 ↑ 5.9 802,076 1

Bitmap Index Scan on kinetic_stats_2019_p_stats_time_granularity_identifier_id_idx (cost=0.00..116,690.25 rows=4,758,277 width=0) (actual time=917.868..917.869 rows=802,076 loops=1)

  • Index Cond: ((granularity)::text = 'HOUR'::text)