Limit (cost=2740.03..2740.03 rows=1 width=96) (actual time=7712.844..7712.923 rows=40 loops=1) -> Sort (cost=2740.03..2740.03 rows=1 width=96) (actual time=7712.840..7712.840 rows=40 loops=1) Sort Key: count(m.post_id) -> HashAggregate (cost=2740.01..2740.02 rows=1 width=96) (actual time=7700.404..7704.470 rows=3726 loops=1) -> Nested Loop (cost=13.19..2740.00 rows=1 width=96) (actual time=3.379..7682.910 rows=9123 loops=1) -> Index Scan using dc_idx_blog_post_post_status on dc_post p (cost=0.00..590.28 rows=118 width=44) (actual time=0.167..17.707 rows=3083 loops=1) Index Cond: (((blog_id)::text = 'b4c62627b3203e7780078cf2f6373ab5'::text) AND (post_status = 1)) Filter: (post_password IS NULL) -> Bitmap Heap Scan on dc_meta m (cost=13.19..18.21 rows=1 width=60) (actual time=2.476..2.480 rows=3 loops=3083) Recheck Cond: ((m.post_id = "outer".post_id) AND ((m.blog_id)::text = 'b4c62627b3203e7780078cf2f6373ab5'::text)) Filter: ((meta_type)::text = 'tag'::text) -> BitmapAnd (cost=13.19..13.19 rows=1 width=0) (actual time=2.472..2.472 rows=0 loops=3083) -> Bitmap Index Scan on dc_idx_meta_post_id (cost=0.00..3.02 rows=292 width=0) (actual time=0.042..0.042 rows=3 loops=3083) Index Cond: (m.post_id = "outer".post_id) -> Bitmap Index Scan on dc_idx_meta_blog_id (cost=0.00..9.92 rows=834 width=0) (actual time=2.737..2.737 rows=9326 loops=2735) Index Cond: ((blog_id)::text = 'b4c62627b3203e7780078cf2f6373ab5'::text) Total runtime: 7713.392 ms