Seq Scan on posts  (cost=0.00..106264.23 rows=1100 width=46)
  SubPlan 1
    ->  Aggregate  (cost=30.35..30.36 rows=1 width=190)
          ->  Hash Join  (cost=14.47..30.33 rows=8 width=190)
                Hash Cond: (pictures.id = posts_pictures.picture_id)
                ->  Seq Scan on pictures  (cost=0.00..14.20 rows=420 width=206)
                ->  Hash  (cost=14.37..14.37 rows=8 width=16)
                      ->  Bitmap Heap Scan on posts_pictures  (cost=4.21..14.37 rows=8 width=16)
                            Recheck Cond: (post_id = posts.id)
                            ->  Bitmap Index Scan on posts_pictures_pkey  (cost=0.00..4.21 rows=8 width=0)
                                  Index Cond: (post_id = posts.id)
  SubPlan 2
    ->  Aggregate  (cost=32.61..32.62 rows=1 width=146)
          ->  Hash Join  (cost=15.05..32.58 rows=11 width=146)
                Hash Cond: (destinations.id = posts_destinations.destination_id)
                ->  Seq Scan on destinations  (cost=0.00..15.40 rows=540 width=150)
                ->  Hash  (cost=14.91..14.91 rows=11 width=4)
                      ->  Bitmap Heap Scan on posts_destinations  (cost=4.24..14.91 rows=11 width=4)
                            Recheck Cond: (post_id = posts.id)
                            ->  Bitmap Index Scan on posts_destinations_pkey  (cost=0.00..4.24 rows=11 width=0)
                                  Index Cond: (post_id = posts.id)
  SubPlan 3
    ->  Aggregate  (cost=33.59..33.60 rows=1 width=42)
          ->  Hash Join  (cost=15.05..33.56 rows=11 width=42)
                Hash Cond: (hashtags.id = posts_hashtags.hashtag_id)
                ->  Seq Scan on hashtags  (cost=0.00..15.02 rows=902 width=46)
                ->  Hash  (cost=14.91..14.91 rows=11 width=4)
                      ->  Bitmap Heap Scan on posts_hashtags  (cost=4.24..14.91 rows=11 width=4)
                            Recheck Cond: (post_id = posts.id)
                            ->  Bitmap Index Scan on posts_hashtags_pkey  (cost=0.00..4.24 rows=11 width=0)
                                  Index Cond: (post_id = posts.id)

Изменить пасту