explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LxxS

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 398.514 ↑ 1.0 5 1

Limit (cost=30,255.52..30,255.53 rows=5 width=1,893) (actual time=398.510..398.514 rows=5 loops=1)

  • loops=1)
2. 0.038 398.509 ↑ 432.6 5 1

Sort (cost=30,255.52..30,260.93 rows=2,163 width=1,893) (actual time=398.509..398.509 rows=5 loops=1)

  • Sort Key: m.start_date DESC, m.sort_order, m.title
  • Sort Method: quicksort Memory: 42kB
3. 0.012 398.471 ↑ 216.3 10 1

Unique (cost=30,121.79..30,197.96 rows=2,163 width=1,893) (actual time=398.459..398.471 rows=10 loops=1)

4. 0.135 398.459 ↑ 1,088.1 14 1

Sort (cost=30,121.79..30,159.88 rows=15,234 width=1,893) (actual time=398.457..398.459 rows=14 loops=1)

  • Sort Key: m.sponsor, m.start_date DESC, m.sort_order, m.title
  • Sort Method: quicksort Memory: 50kB
5. 0.076 398.324 ↑ 1,088.1 14 1

Nested Loop (cost=2.29..29,063.41 rows=15,234 width=1,893) (actual time=14.024..398.324 rows=14 loops=1)

6. 0.101 0.168 ↑ 1.0 32 1

Hash Join (cost=1.88..3.37 rows=32 width=34) (actual time=0.094..0.168 rows=32 loops=1)

  • Hash Cond: (mt.id = media_resource_type.id)
  • -> Seq Scan on media_resource_type mt (cost=0.00..1.38 rows=38 width=30) (actual time=0.014..0.034 rows=38
7. 0.015 0.067 ↑ 1.0 32 1

Hash (cost=1.48..1.48 rows=32 width=4) (actual time=0.066..0.067 rows=32 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
8. 0.052 0.052 ↑ 1.0 32 1

Seq Scan on media_resource_type (cost=0.00..1.48 rows=32 width=4) (actual time=0.024..0.052 rows=32 loops=1)

  • Filter: (path && '{2}'::integer[])
  • Rows Removed by Filter: 6
9. 398.080 398.080 ↓ 0.0 0 32

Index Scan using idx_media_res_type_id on media_resource m (cost=0.42..902.96 rows=517 width=1,867) (actual time=2.593..12.440 rows=0 loops=32)

  • Index Cond: (resource_type_id = mt.id)
  • Filter: ((locale_id = ANY ('{0,1}'::integer[])) AND (status_id = 6) AND ((brand_list_perms & 1024) > 0) AND (start_date < (CURRENT_TIMESTAMP(0))::timestamp without time zone) AND (((end_date + '1 day'::interval) > (CURRENT_TIMESTAMP(0))::timestamp without time zone) OR (end_date IS NULL)) AND ((media_resource_origin_id = 2) OR (media_resource_origin_id = 3) OR ((media_resource_origin_id = 1) AND (sponsor IS NOT NULL) AND ((sponsor)::text <> ''::text) AND (reg_url IS NOT NULL) AND ((reg_url)::text <> ''::text) AND ((CURRENT_TIMESTAMP(0))::timestamp without time zone >= sponsorship_start_date) AND ((CURRENT_TIMESTAMP(0))::timestamp without time zone <= sponsorship_end_date))))
  • Rows Removed by Filter: 5055
Planning time : 1.879 ms
Execution time : 398.686 ms