explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Olfp

Settings
# exclusive inclusive rows x rows loops node
1. 0.619 61.422 ↓ 276.0 276 1

Sort (cost=286.78..286.79 rows=1 width=501) (actual time=61.393..61.422 rows=276 loops=1)

  • Sort Key: identities.number_of_followers DESC
  • Sort Method: quicksort Memory: 183kB
2. 1.233 60.803 ↓ 276.0 276 1

Nested Loop Semi Join (cost=10.91..286.77 rows=1 width=501) (actual time=0.560..60.803 rows=276 loops=1)

  • Join Filter: (influencers_roles.influencer_id = i_2.influencer_id)
3. 1.500 56.800 ↓ 1,385.0 1,385 1

Nested Loop Semi Join (cost=10.49..285.49 rows=1 width=537) (actual time=0.337..56.800 rows=1,385 loops=1)

  • Join Filter: (influencers_roles.influencer_id = i_1.influencer_id)
4. 0.784 50.622 ↓ 2,339.0 2,339 1

Nested Loop Semi Join (cost=10.07..284.21 rows=1 width=533) (actual time=0.325..50.622 rows=2,339 loops=1)

5. 0.560 45.160 ↓ 2,339.0 2,339 1

Nested Loop (cost=9.66..283.04 rows=1 width=529) (actual time=0.317..45.160 rows=2,339 loops=1)

6. 4.551 35.252 ↓ 2,337.0 2,337 1

Nested Loop (cost=9.24..281.76 rows=1 width=521) (actual time=0.306..35.252 rows=2,337 loops=1)

  • Join Filter: (influencers_roles.role_id = roles.id)
  • Rows Removed by Join Filter: 21
7. 2.436 30.701 ↓ 2,358.0 2,358 1

Nested Loop (cost=9.24..280.72 rows=1 width=529) (actual time=0.300..30.701 rows=2,358 loops=1)

8. 1.370 23.549 ↓ 2,358.0 2,358 1

Nested Loop (cost=8.95..280.24 rows=1 width=32) (actual time=0.290..23.549 rows=2,358 loops=1)

9. 2.094 17.497 ↓ 780.3 2,341 1

Hash Join (cost=8.66..279.05 rows=3 width=16) (actual time=0.281..17.497 rows=2,341 loops=1)

  • Hash Cond: (influencer_taggings_a32f272.tag_id = tags_1.id)
10. 1.405 15.353 ↓ 33.6 15,503 1

Nested Loop (cost=5.72..274.86 rows=462 width=24) (actual time=0.216..15.353 rows=15,503 loops=1)

11. 0.566 1.987 ↓ 29.5 3,987 1

Nested Loop (cost=5.43..216.79 rows=135 width=8) (actual time=0.208..1.987 rows=3,987 loops=1)

12. 0.043 0.043 ↑ 1.0 1 1

Seq Scan on tags (cost=0.00..2.92 rows=1 width=8) (actual time=0.036..0.043 rows=1 loops=1)

  • Filter: ((name)::text ~~* 'lifestyle'::text)
  • Rows Removed by Filter: 153
13. 1.229 1.378 ↓ 26.9 3,987 1

Bitmap Heap Scan on taggings influencer_taggings_1e2f761 (cost=5.43..212.39 rows=148 width=16) (actual time=0.169..1.378 rows=3,987 loops=1)

  • Recheck Cond: (tag_id = tags.id)
  • Filter: ((taggable_type)::text = 'Influencer'::text)
  • Heap Blocks: exact=215
14. 0.149 0.149 ↓ 26.9 3,987 1

Bitmap Index Scan on index_taggings_on_tag_id (cost=0.00..5.40 rows=148 width=0) (actual time=0.149..0.149 rows=3,987 loops=1)

  • Index Cond: (tag_id = tags.id)
15. 11.961 11.961 ↓ 1.3 4 3,987

Index Scan using index_taggings_on_taggable_id on taggings influencer_taggings_a32f272 (cost=0.29..0.40 rows=3 width=16) (actual time=0.002..0.003 rows=4 loops=3,987)

  • Index Cond: (taggable_id = influencer_taggings_1e2f761.taggable_id)
  • Filter: ((taggable_type)::text = 'Influencer'::text)
16. 0.002 0.050 ↑ 1.0 1 1

Hash (cost=2.92..2.92 rows=1 width=8) (actual time=0.050..0.050 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
17. 0.048 0.048 ↑ 1.0 1 1

Seq Scan on tags tags_1 (cost=0.00..2.92 rows=1 width=8) (actual time=0.045..0.048 rows=1 loops=1)

  • Filter: ((name)::text ~~* 'profils féminins'::text)
  • Rows Removed by Filter: 153
18. 4.682 4.682 ↑ 1.0 1 2,341

Index Scan using index_influencers_roles_on_influencer_id on influencers_roles (cost=0.29..0.39 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=2,341)

  • Index Cond: (influencer_id = influencer_taggings_1e2f761.taggable_id)
19. 4.716 4.716 ↑ 1.0 1 2,358

Index Scan using influencers_pkey on influencers (cost=0.29..0.48 rows=1 width=497) (actual time=0.002..0.002 rows=1 loops=2,358)

  • Index Cond: (id = influencers_roles.influencer_id)
20. 0.000 0.000 ↑ 1.0 1 2,358

Seq Scan on roles (cost=0.00..1.02 rows=1 width=8) (actual time=0.000..0.000 rows=1 loops=2,358)

  • Filter: ((name)::text = 'yoo'::text)
  • Rows Removed by Filter: 0
21. 9.348 9.348 ↑ 1.0 1 2,337

Index Scan using index_identities_on_influencer_id on identities (cost=0.42..1.27 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=2,337)

  • Index Cond: (influencer_id = influencers_roles.influencer_id)
  • Filter: ((provider)::text = 'instagram'::text)
  • Rows Removed by Filter: 2
22. 4.678 4.678 ↑ 1.0 1 2,339

Index Scan using index_identities_on_influencer_id on identities i (cost=0.42..1.27 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=2,339)

  • Index Cond: (influencer_id = influencers_roles.influencer_id)
  • Filter: ((provider)::text = 'instagram'::text)
  • Rows Removed by Filter: 1
23. 4.678 4.678 ↑ 1.0 1 2,339

Index Scan using index_identities_on_influencer_id on identities i_1 (cost=0.42..1.27 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=2,339)

  • Index Cond: (influencer_id = identities.influencer_id)
  • Filter: ((provider)::text = 'facebook'::text)
  • Rows Removed by Filter: 1
24. 2.770 2.770 ↓ 0.0 0 1,385

Index Scan using index_identities_on_influencer_id on identities i_2 (cost=0.42..1.27 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=1,385)

  • Index Cond: (influencer_id = identities.influencer_id)
  • Filter: ((provider)::text = 'twitter'::text)
  • Rows Removed by Filter: 3
Planning time : 17.264 ms