Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
query plan
Nested Loop Left Join (cost=5983.86..6366.71 rows=94 width=537) (actual time=761.201..782.318 rows=100 loops=1)
-> Nested Loop Left Join (cost=5983.57..6179.51 rows=94 width=225) (actual time=761.169..762.363 rows=100 loops=1)
-> Limit (cost=5983.00..5983.23 rows=94 width=48) (actual time=761.129..761.179 rows=100 loops=1)
-> Sort (cost=5983.00..5983.23 rows=94 width=48) (actual time=761.127..761.160 rows=100 loops=1)
Sort Key: post.scheduled_date DESC
Sort Method: top-N heapsort Memory: 49kB
-> Nested Loop (cost=2849.86..5979.92 rows=94 width=48) (actual time=597.822..760.361 rows=2156 loops=1)
-> Hash Join (cost=2849.57..5891.80 rows=235 width=52) (actual time=597.749..685.998 rows=2157 loops=1)
Hash Cond: (vote.post_id =
-> Bitmap Heap Scan on vote (cost=1632.07..4665.51 rows=3350 width=4) (actual time=190.731..242.607 rows=5131 loops=1)
Recheck Cond: (((user_id)::text = ANY ('{IBS7ftMAytR3HpMCtk3jzixnuIk1,78c4CKECYWSVt3RmOIgA0U6x7Z12,fjHvzaoyr2OvW2SoWQeB3w5tGQB2}'::text[])) AND (vote > 15))
Heap Blocks: exact=1238
-> BitmapAnd (cost=1632.07..1632.07 rows=3350 width=0) (actual time=190.508..190.508 rows=0 loops=1)
-> Bitmap Index Scan on index1 (cost=0.00..292.12 rows=20113 width=0) (actual time=37.563..37.563 rows=20667 loops=1)
Index Cond: ((user_id)::text = ANY ('{IBS7ftMAytR3HpMCtk3jzixnuIk1,78c4CKECYWSVt3RmOIgA0U6x7Z12,fjHvzaoyr2OvW2SoWQeB3w5tGQB2}'::text[]))
-> Bitmap Index Scan on index4 (cost=0.00..1338.03 rows=125947 width=0) (actual time=142.625..142.625 rows=131349 loops=1)
Index Cond: (vote > 15)
-> Hash (cost=1164.34..1164.34 rows=4253 width=48) (actual time=406.966..406.966 rows=16497 loops=1)
Buckets: 32768 (originally 8192) Batches: 1 (originally 1) Memory Usage: 1610kB
-> Index Scan using index5 on post (cost=26.48..1164.34 rows=4253 width=48) (actual time=12.489..317.845 rows=16497 loops=1)
Index Cond: (scheduled_date <= '2019-06-19 00:00:00'::timestamp without time zone)
Filter: ((parent_post_id IS NULL) AND (NOT (hashed SubPlan 1)))
Rows Removed by Filter: 3089
SubPlan 1
-> Seq Scan on blocked_user (cost=0.00..26.18 rows=4 width=28) (actual time=0.129..12.421 rows=1 loops=1)
Filter: (((user_id)::text = 'snaildragon'::text) OR ((user_id)::text = ANY ('{IBS7ftMAytR3HpMCtk3jzixnuIk1,78c4CKECYWSVt3RmOIgA0U6x7Z12,fjHvzaoyr2OvW2SoWQeB3w5tGQB2}'::text[])))
Rows Removed by Filter: 666
-> Index Only Scan using index6 on content_post content_post_1 (cost=0.29..0.36 rows=1 width=4) (actual time=0.028..0.034 rows=1 loops=2157)
Index Cond: (post_id =
Heap Fetches: 1998
-> Nested Loop (cost=0.57..2.07 rows=1 width=177) (actual time=0.010..0.011 rows=1 loops=100)
-> Index Scan using index6 on content_post content_post_2 (cost=0.29..1.72 rows=1 width=28) (actual time=0.003..0.003 rows=1 loops=100)
Index Cond: ( = post_id)
-> Index Scan using content_pkey on content content_1 (cost=0.29..0.35 rows=1 width=149) (actual time=0.006..0.006 rows=1 loops=100)
Index Cond: (id = content_post_2.content_id)
-> Index Scan using user_pkey on "user" user_1 (cost=0.28..1.99 rows=1 width=304) (actual time=0.198..0.198 rows=1 loops=100)
Index Cond: ((id)::text = (post.user_id)::text)
Planning Time: 34.702 ms
Execution Time: 782.708 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.