explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SO4d

Settings
# exclusive inclusive rows x rows loops node
1. 12.276 143.466 ↓ 291.2 10,775 1

Sort (cost=304.17..304.27 rows=37 width=12) (actual time=138.521..143.466 rows=10,775 loops=1)

  • Sort Key: audience_schedule.screen_id, ((day.day)::date)
  • Sort Method: quicksort Memory: 890kB
2. 97.697 131.190 ↓ 291.2 10,775 1

Nested Loop (cost=25.16..303.21 rows=37 width=12) (actual time=0.240..131.190 rows=10,775 loops=1)

  • Join Filter: ((day.day >= audience_schedule.start_date) AND (day.day <= audience_schedule.end_date) AND (((('2'::double precision ^ (date_part('isodow'::text, day.day) - '1'::double precision)))::integer & audience_schedule.dow_mask) > 0))
  • Rows Removed by Join Filter: 64555
3. 1.766 1.903 ↓ 810.0 810 1

Bitmap Heap Scan on audience_schedule (cost=25.15..263.11 rows=1 width=20) (actual time=0.168..1.903 rows=810 loops=1)

  • Recheck Cond: (screen_id = ANY ('{29919,30599,30588,30380,30088,30154,30454,30600,30382,30389}'::integer[]))
  • Filter: ((start_date IS NOT NULL) AND (end_date IS NOT NULL) AND (daterange(start_date, end_date, '[]'::text) && '[2019-06-05,2019-09-06)'::daterange))
  • Rows Removed by Filter: 10
  • Heap Blocks: exact=34
4. 0.137 0.137 ↓ 6.3 820 1

Bitmap Index Scan on audience_schedule_screen_id_impression_total_index (cost=0.00..25.15 rows=131 width=0) (actual time=0.137..0.137 rows=820 loops=1)

  • Index Cond: (screen_id = ANY ('{29919,30599,30588,30380,30088,30154,30454,30600,30382,30389}'::integer[]))
5. 31.590 31.590 ↑ 10.8 93 810

Function Scan on generate_series day (cost=0.01..10.01 rows=1,000 width=8) (actual time=0.000..0.039 rows=93 loops=810)

Planning time : 0.267 ms
Execution time : 147.981 ms