explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 67k5

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 299.246 ↑ 1.0 20 1

Limit (cost=54,918.85..54,949.82 rows=20 width=432) (actual time=293.683..299.246 rows=20 loops=1)

2. 4.285 299.239 ↑ 30.6 20 1

SetOp Intersect (cost=54,918.85..55,868.02 rows=613 width=432) (actual time=293.682..299.239 rows=20 loops=1)

3. 160.636 294.954 ↑ 2.2 5,283 1

Sort (cost=54,918.85..54,947.62 rows=11,505 width=432) (actual time=292.461..294.954 rows=5,283 loops=1)

  • Sort Key: "*SELECT* 2".id, "*SELECT* 2".handle_id, "*SELECT* 2".post_id, "*SELECT* 2".post, "*SELECT* 2".child_post_id, "*SELECT* 2".parent_post_id, "*SELECT* 2".sentiment, "*SELECT* 2".date, "*SELECT* 2".created_on, "*SELECT* 2".source, "*SELECT* 2".likes_count, "*SELECT* 2".comments_count, "*SELECT* 2".shares_count, "*SELECT* 2".updated_on, "*SELECT* 2".uri, "*SELECT* 2".views_count, "*SELECT* 2".preview_uri, "*SELECT* 2".reaction_total_count, "*SELECT* 2".reaction_like_count, "*SELECT* 2".reaction_love_count, "*SELECT* 2".reaction_wow_count, "*SELECT* 2".reaction_haha_count, "*SELECT* 2".reaction_sad_count, "*SELECT* 2".reaction_angry_count, "*SELECT* 2".reaction_thankful_count, "*SELECT* 2".reaction_pride_count, "*SELECT* 2".text_search_words, "*SELECT* 2".mentioned_uids, "*SELECT* 2".impressions_count, "*SELECT* 2".clicks_count, "*SELECT* 2".engagement_rate, "*SELECT* 2".job
  • Sort Method: external merge Disk: 15616kB
4. 3.840 134.318 ↓ 2.7 30,632 1

Append (cost=124.91..51,899.34 rows=11,505 width=432) (actual time=1.132..134.318 rows=30,632 loops=1)

5. 0.656 19.468 ↓ 2.6 1,570 1

Subquery Scan on *SELECT* 2 (cost=124.91..2,527.93 rows=613 width=755) (actual time=1.132..19.468 rows=1,570 loops=1)

6. 17.905 18.812 ↓ 2.6 1,570 1

Bitmap Heap Scan on posts (cost=124.91..2,521.80 rows=613 width=751) (actual time=1.130..18.812 rows=1,570 loops=1)

  • Recheck Cond: ((text_search_words @@ '''mirunn'' | ''food'''::tsquery) OR (mentioned_uids && '{2087947767926096,401328537106759,441940055873460,132560043518789,1196463420517229,urn:li:organizationBrand:9394172}'::text[]))
  • Heap Blocks: exact=1368
7. 0.001 0.907 ↓ 0.0 0 1

BitmapOr (cost=124.91..124.91 rows=614 width=0) (actual time=0.907..0.907 rows=0 loops=1)

8. 0.854 0.854 ↓ 3.2 1,841 1

Bitmap Index Scan on tsw_idx (cost=0.00..48.34 rows=579 width=0) (actual time=0.854..0.854 rows=1,841 loops=1)

  • Index Cond: (text_search_words @@ '''mirunn'' | ''food'''::tsquery)
9. 0.052 0.052 ↓ 0.0 0 1

Bitmap Index Scan on mentioned_uids_index (cost=0.00..76.26 rows=35 width=0) (actual time=0.052..0.052 rows=0 loops=1)

  • Index Cond: (mentioned_uids && '{2087947767926096,401328537106759,441940055873460,132560043518789,1196463420517229,urn:li:organizationBrand:9394172}'::text[])
10. 7.410 111.010 ↓ 2.7 29,062 1

Subquery Scan on *SELECT* 1 (cost=11,068.06..49,371.42 rows=10,892 width=755) (actual time=6.422..111.010 rows=29,062 loops=1)

11. 98.449 103.600 ↓ 2.7 29,062 1

Bitmap Heap Scan on posts posts_1 (cost=11,068.06..49,262.50 rows=10,892 width=751) (actual time=6.420..103.600 rows=29,062 loops=1)

  • Recheck Cond: ((date >= '2019-05-05 14:00:00'::timestamp without time zone) AND (date <= '2019-05-13 13:59:59.999999'::timestamp without time zone))
  • Heap Blocks: exact=5609
12. 5.151 5.151 ↓ 2.8 30,219 1

Bitmap Index Scan on posts_date_index (cost=0.00..11,065.34 rows=10,892 width=0) (actual time=5.151..5.151 rows=30,219 loops=1)

  • Index Cond: ((date >= '2019-05-05 14:00:00'::timestamp without time zone) AND (date <= '2019-05-13 13:59:59.999999'::timestamp without time zone))