explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uNvX

Settings
# exclusive inclusive rows x rows loops node
1. 0.105 93,120.927 ↓ 41.0 41 1

Limit (cost=188.08..188.08 rows=1 width=363) (actual time=93,120.747..93,120.927 rows=41 loops=1)

2. 171.835 93,120.822 ↓ 41.0 41 1

Sort (cost=188.08..188.08 rows=1 width=363) (actual time=93,120.743..93,120.822 rows=41 loops=1)

  • Sort Key: m.id COLLATE "C" DESC
  • Sort Method: top-N heapsort Memory: 148kB
3. 38,279.326 92,948.987 ↓ 24,312.0 24,312 1

GroupAggregate (cost=187.65..188.07 rows=1 width=363) (actual time=48,445.770..92,948.987 rows=24,312 loops=1)

  • Group Key: m.id
4. 38,907.614 54,669.661 ↓ 90,160.8 1,803,216 1

Sort (cost=187.65..187.70 rows=20 width=1,259) (actual time=48,444.617..54,669.661 rows=1,803,216 loops=1)

  • Sort Key: m.id
  • Sort Method: external merge Disk: 1,944,000kB
5. 5,740.439 15,762.047 ↓ 90,160.8 1,803,216 1

Nested Loop Left Join (cost=39.23..187.22 rows=20 width=1,259) (actual time=48.328..15,762.047 rows=1,803,216 loops=1)

6. 408.166 1,706.762 ↓ 56,951.0 113,902 1

Nested Loop Left Join (cost=38.80..95.75 rows=2 width=1,005) (actual time=48.299..1,706.762 rows=113,902 loops=1)

7. 146.166 564.886 ↓ 24,457.0 24,457 1

Nested Loop Left Join (cost=38.38..70.12 rows=1 width=706) (actual time=48.270..564.886 rows=24,457 loops=1)

8. 250.644 272.848 ↓ 24,312.0 24,312 1

Bitmap Heap Scan on content_message_031 m (cost=38.10..61.82 rows=1 width=548) (actual time=48.246..272.848 rows=24,312 loops=1)

  • Recheck Cond: (((attrs ->> 'linkedToId'::text) IS NULL) AND ((((attrs -> 'status'::text) ->> 'code'::text))::integer = ANY ('{0,1}'::integer[])))
  • Filter: (((type)::text = ANY ('{post,photo}'::text[])) AND ((event)::text = 's_rjjiyf'::text))
  • Rows Removed by Filter: 87,533
  • Heap Blocks: exact=9,032
9. 1.053 22.204 ↓ 0.0 0 1

BitmapAnd (cost=38.10..38.10 rows=6 width=0) (actual time=22.204..22.204 rows=0 loops=1)

10. 8.390 8.390 ↓ 199.8 111,902 1

Bitmap Index Scan on content_message_031_attrs_linked_to_id (cost=0.00..12.62 rows=560 width=0) (actual time=8.390..8.390 rows=111,902 loops=1)

  • Index Cond: ((attrs ->> 'linkedToId'::text) IS NULL)
11. 12.761 12.761 ↓ 100.0 112,012 1

Bitmap Index Scan on content_message_031_attrs_status_code (cost=0.00..25.23 rows=1,120 width=0) (actual time=12.761..12.761 rows=112,012 loops=1)

  • Index Cond: ((((attrs -> 'status'::text) ->> 'code'::text))::integer = ANY ('{0,1}'::integer[]))
12. 145.872 145.872 ↓ 0.0 0 24,312

Index Scan using content_inappropriate_report_031_message_id on content_inappropriate_report_031 i (cost=0.28..8.29 rows=1 width=179) (actual time=0.006..0.006 rows=0 loops=24,312)

  • Index Cond: ((message_id)::text = (m.id)::text)
13. 733.710 733.710 ↑ 1.2 5 24,457

Index Scan using content_reply_031_message_id on content_reply_031 r (cost=0.42..25.56 rows=6 width=322) (actual time=0.010..0.030 rows=5 loops=24,457)

  • Index Cond: ((message_id)::text = (m.id)::text)
14. 8,314.846 8,314.846 ↓ 1.1 16 113,902

Index Scan using content_like_031_message_id on content_like_031 l (cost=0.42..45.60 rows=14 width=278) (actual time=0.009..0.073 rows=16 loops=113,902)

  • Index Cond: ((message_id)::text = (m.id)::text)
Planning time : 1.119 ms
Execution time : 93,423.542 ms