Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created February 15, 2018 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6d251b277ef71f8977b03cab91fedccd to your computer and use it in GitHub Desktop.
Save anonymous/6d251b277ef71f8977b03cab91fedccd to your computer and use it in GitHub Desktop.
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=98624.84..98624.96 rows=10 width=74) (actual time=0.130..0.130 rows=0 loops=1)
Buffers: shared hit=3
-> Sort (cost=98624.84..99874.84 rows=500000 width=74) (actual time=0.119..0.119 rows=0 loops=1)
Sort Key: posts.id DESC
Sort Method: quicksort Memory: 25kB
Buffers: shared hit=3
-> Hash Join (cost=17.92..29077.92 rows=500000 width=74) (actual time=0.104..0.104 rows=0 loops=1)
Hash Cond: (posts.user_id = users.id)
Buffers: shared hit=3
-> Seq Scan on posts (cost=0.00..20310.00 rows=1000000 width=49) (actual time=0.015..0.015 rows=1 loops=1)
Buffers: shared hit=1
-> Hash (cost=17.29..17.29 rows=50 width=49) (actual time=0.069..0.069 rows=0 loops=1)
Buckets: 1024 Batches: 1 Memory Usage: 8kB
Buffers: shared hit=2
-> Hash Join (cost=14.88..17.29 rows=50 width=49) (actual time=0.059..0.059 rows=0 loops=1)
Hash Cond: (users.id = friends.friend_user_id)
Buffers: shared hit=2
-> Seq Scan on users (cost=0.00..2.00 rows=100 width=41) (actual time=0.010..0.010 rows=1 loops=1)
Buffers: shared hit=1
-> Hash (cost=14.76..14.76 rows=9 width=8) (actual time=0.029..0.029 rows=0 loops=1)
Buckets: 1024 Batches: 1 Memory Usage: 8kB
Buffers: shared hit=1
-> Bitmap Heap Scan on friends (cost=4.22..14.76 rows=9 width=8) (actual time=0.019..0.019 rows=0 loops=1)
Recheck Cond: (user_id = 2)
Buffers: shared hit=1
-> Bitmap Index Scan on friends_user_id_friend_user_id_key (cost=0.00..4.22 rows=9 width=0) (actual time=0.010..0.010 rows=0 loops=1)
Index Cond: (user_id = 2)
Buffers: shared hit=1
Planning time: 0.542 ms
Execution time: 0.184 ms
(30 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment