Limit (cost=4031.92..4031.92 rows=1 width=96) (actual time=66.881..66.934 rows=40 loops=1) -> Sort (cost=4031.92..4031.92 rows=1 width=96) (actual time=66.879..66.905 rows=40 loops=1) Sort Key: count(m.post_id) -> HashAggregate (cost=4031.90..4031.91 rows=1 width=96) (actual time=54.785..58.600 rows=3726 loops=1) -> Hash Join (cost=582.57..4031.89 rows=1 width=96) (actual time=15.047..40.772 rows=9128 loops=1) Hash Cond: ("outer".post_id = "inner".post_id) -> Bitmap Heap Scan on dc_meta m (cost=9.92..3455.06 rows=834 width=60) (actual time=3.413..15.116 rows=9326 loops=1) Recheck Cond: ((blog_id)::text = 'b4c62627b3203e7780078cf2f6373ab5'::text) Filter: ((meta_type)::text = 'tag'::text) -> Bitmap Index Scan on dc_idx_meta_blog_id (cost=0.00..9.92 rows=834 width=0) (actual time=2.829..2.829 rows=9326 loops=1) Index Cond: ((blog_id)::text = 'b4c62627b3203e7780078cf2f6373ab5'::text) -> Hash (cost=572.35..572.35 rows=118 width=44) (actual time=11.567..11.567 rows=3084 loops=1) -> Bitmap Heap Scan on dc_post p (cost=2.71..572.35 rows=118 width=44) (actual time=2.472..8.466 rows=3084 loops=1) Recheck Cond: (((blog_id)::text = 'b4c62627b3203e7780078cf2f6373ab5'::text) AND (post_status = 1)) Filter: (post_password IS NULL) -> Bitmap Index Scan on dc_idx_blog_post_post_status (cost=0.00..2.71 rows=118 width=0) (actual time=1.533..1.533 rows=3084 loops=1) Index Cond: (((blog_id)::text = 'b4c62627b3203e7780078cf2f6373ab5'::text) AND (post_status = 1)) Total runtime: 67.315 ms