explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4xGF

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 0.056 ↓ 0.0 0 1

Limit (cost=1,113.31..1,113.31 rows=1 width=1,374) (actual time=0.055..0.056 rows=0 loops=1)

2. 0.024 0.054 ↓ 0.0 0 1

Sort (cost=1,113.31..1,113.31 rows=1 width=1,374) (actual time=0.054..0.054 rows=0 loops=1)

  • Sort Key: posts.date DESC
  • Sort Method: quicksort Memory: 25kB
3. 0.001 0.030 ↓ 0.0 0 1

Nested Loop Anti Join (cost=1,098.58..1,113.30 rows=1 width=1,374) (actual time=0.029..0.030 rows=0 loops=1)

  • Join Filter: (relationships_1.followed_id = posts.user_id)
4. 0.001 0.029 ↓ 0.0 0 1

Nested Loop (cost=1.57..5.98 rows=1 width=1,374) (actual time=0.029..0.029 rows=0 loops=1)

5. 0.001 0.028 ↓ 0.0 0 1

Nested Loop (cost=1.00..5.04 rows=1 width=458) (actual time=0.028..0.028 rows=0 loops=1)

6. 0.027 0.027 ↓ 0.0 0 1

Index Scan using index_relationships_on_follower_id_and_status on relationships (cost=0.57..2.59 rows=1 width=4) (actual time=0.027..0.027 rows=0 loops=1)

  • Index Cond: ((follower_id = 2,276,790) AND (status = 1))
7. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users (cost=0.44..2.46 rows=1 width=454) (never executed)

  • Index Cond: (id = relationships.followed_id)
8. 0.000 0.000 ↓ 0.0 0

Index Scan using index_posts_on_user_id_and_date on posts (cost=0.56..0.93 rows=1 width=920) (never executed)

  • Index Cond: ((user_id = users.id) AND (date <= '2019-01-13 10:53:05.213174'::timestamp without time zone) AND (date > '2020-05-13 19:05:54.206367'::timestamp without time zone))
  • Filter: (is_deleted AND ((NOT invisible) OR (user_id = 10,753,607)) AND ((type)::text <> ALL ('{TextPost,TextPost}'::text[])) AND ((group_uuid IS NULL) OR ((group_uuid)::text = '6bc4347f-a64b-4044-ab20-7c2551b58551'::text)) AND ((locale)::text = 'en-US'::text) AND ((NOT users.invisible) OR (user_id = 10,753,607)) AND ((type)::text <> ALL ('{PhotoPost,PhotoPost,PhotoPost,PhotoPost}'::text[])))
9. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=1,097.01..1,100.18 rows=317 width=4) (never executed)

  • Group Key: relationships_1.followed_id
10. 0.000 0.000 ↓ 0.0 0

Append (cost=0.57..1,096.22 rows=317 width=4) (never executed)

11. 0.000 0.000 ↓ 0.0 0

Index Scan using index_relationships_on_follower_id_and_status on relationships relationships_1 (cost=0.57..257.02 rows=314 width=4) (never executed)

  • Index Cond: ((follower_id = 20,110,755) AND (status = ANY ('{0,1}'::integer[])))
12. 0.000 0.000 ↓ 0.0 0

Index Scan using index_relationships_on_followed_id on relationships relationships_2 (cost=0.57..836.03 rows=3 width=4) (never executed)

  • Index Cond: (followed_id = 2,276,790)
  • Filter: (status = 1)
Planning time : 3.967 ms
Execution time : 3.773 ms