explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kBs

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 427,242.541 ↑ 50,696.3 3 1

Unique (cost=1,295,965.75..1,297,486.64 rows=152,089 width=72) (actual time=427,242.539..427,242.541 rows=3 loops=1)

2. 0.062 427,242.539 ↑ 50,696.3 3 1

Sort (cost=1,295,965.75..1,296,345.97 rows=152,089 width=72) (actual time=427,242.538..427,242.539 rows=3 loops=1)

  • Sort Key: ('ARENA_WIDGET'::text), events.widget_type, (count(*))
  • Sort Method: quicksort Memory: 25kB
3. 0.002 427,242.477 ↑ 50,696.3 3 1

Append (cost=438,707.67..1,276,634.52 rows=152,089 width=72) (actual time=3,264.584..427,242.477 rows=3 loops=1)

4. 0.016 3,264.584 ↑ 13.0 1 1

HashAggregate (cost=438,707.67..438,707.80 rows=13 width=49) (actual time=3,264.583..3,264.584 rows=1 loops=1)

  • Group Key: events.widget_type
5. 2,509.692 3,264.568 ↑ 27,897.3 3 1

Bitmap Heap Scan on events (cost=125,739.85..438,289.21 rows=83,692 width=9) (actual time=2,653.281..3,264.568 rows=3 loops=1)

  • Recheck Cond: (((site_id)::text = 't66js6VS0cTxNPNOP007LXzm3JK2'::text) AND ("timestamp" > (CURRENT_DATE - '30 days'::interval day)))
  • Rows Removed by Index Recheck: 2308535
  • Filter: (widget_type IS NOT NULL)
  • Rows Removed by Filter: 1155100
  • Heap Blocks: lossy=583760
6. 32.022 754.876 ↓ 0.0 0 1

BitmapAnd (cost=125,739.85..125,739.85 rows=85,386 width=0) (actual time=754.876..754.876 rows=0 loops=1)

7. 239.440 239.440 ↓ 1.3 1,812,144 1

Bitmap Index Scan on site_id_idx (cost=0.00..47,088.55 rows=1,356,264 width=0) (actual time=239.440..239.440 rows=1,812,144 loops=1)

  • Index Cond: ((site_id)::text = 't66js6VS0cTxNPNOP007LXzm3JK2'::text)
8. 483.414 483.414 ↓ 1.6 6,757,738 1

Bitmap Index Scan on events_timestamp_idx (cost=0.00..78,609.21 rows=4,305,151 width=0) (actual time=483.414..483.414 rows=6,757,738 loops=1)

  • Index Cond: ("timestamp" > (CURRENT_DATE - '30 days'::interval day))
9. 860.250 423,977.891 ↑ 76,038.0 2 1

GroupAggregate (cost=832,588.49..836,405.83 rows=152,076 width=73) (actual time=423,977.888..423,977.891 rows=2 loops=1)

  • Group Key: (((events_1.context -> 'library'::text) ->> 'name'::text)), events_1.write_key
10. 3,160.667 423,117.641 ↓ 11.8 1,811,196 1

Sort (cost=832,588.49..832,972.54 rows=153,620 width=65) (actual time=422,655.199..423,117.641 rows=1,811,196 loops=1)

  • Sort Key: (((events_1.context -> 'library'::text) ->> 'name'::text)), events_1.write_key
  • Sort Method: external sort Disk: 141784kB
11. 419,138.801 419,956.974 ↓ 11.8 1,811,196 1

Bitmap Heap Scan on events events_1 (cost=271,193.60..813,051.39 rows=153,620 width=65) (actual time=829.758..419,956.974 rows=1,811,196 loops=1)

  • Recheck Cond: (((site_id)::text = 't66js6VS0cTxNPNOP007LXzm3JK2'::text) AND (widget_id IS NULL))
  • Rows Removed by Index Recheck: 3670646
  • Heap Blocks: exact=44953 lossy=925051
12. 15.030 818.173 ↓ 0.0 0 1

BitmapAnd (cost=271,193.60..271,193.60 rows=153,620 width=0) (actual time=818.173..818.173 rows=0 loops=1)

13. 252.360 252.360 ↓ 1.3 1,812,145 1

Bitmap Index Scan on site_id_idx (cost=0.00..47,088.55 rows=1,356,264 width=0) (actual time=252.360..252.360 rows=1,812,145 loops=1)

  • Index Cond: ((site_id)::text = 't66js6VS0cTxNPNOP007LXzm3JK2'::text)
14. 550.783 550.783 ↓ 1.0 7,811,787 1

Bitmap Index Scan on events_widget_id_idx (cost=0.00..224,027.99 rows=7,745,523 width=0) (actual time=550.783..550.783 rows=7,811,787 loops=1)

  • Index Cond: (widget_id IS NULL)
Planning time : 0.390 ms
Execution time : 427,268.231 ms