explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5hSm

Settings
# exclusive inclusive rows x rows loops node
1. 1.153 130.313 ↓ 276.0 276 1

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

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

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

  • Join Filter: (influencers_roles.influencer_id = identities_3.influencer_id)
3. 2.689 122.144 ↓ 1,385.0 1,385 1

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

  • Join Filter: (influencers_roles.influencer_id = identities_2.influencer_id)
4. 2.078 110.099 ↓ 2,339.0 2,339 1

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

5. 3.555 103.343 ↓ 2,339.0 2,339 1

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

6. 3.221 64.733 ↓ 2,337.0 2,337 1

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

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

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

8. 2.276 34.820 ↓ 2,358.0 2,358 1

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

9. 2.461 23.180 ↓ 780.3 2,341 1

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

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

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

11. 0.661 2.953 ↓ 29.5 3,987 1

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

12. 0.041 0.041 ↑ 1.0 1 1

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

  • Filter: ((name)::text ~~* 'lifestyle'::text)
  • Rows Removed by Filter: 153
13. 1.925 2.251 ↓ 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.355..2.251 rows=3,987 loops=1)

  • Recheck Cond: (tag_id = tags.id)
  • Filter: ((taggable_type)::text = 'Influencer'::text)
  • Heap Blocks: exact=215
14. 0.326 0.326 ↓ 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.326..0.326 rows=3,987 loops=1)

  • Index Cond: (tag_id = tags.id)
15. 15.948 15.948 ↓ 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.004 rows=4 loops=3,987)

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

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

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

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

  • Filter: ((name)::text ~~* 'profils féminins'::text)
  • Rows Removed by Filter: 153
18. 9.364 9.364 ↑ 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.004..0.004 rows=1 loops=2,341)

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

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

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

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

  • Filter: ((name)::text = 'yoo'::text)
  • Rows Removed by Filter: 0
21. 35.055 35.055 ↑ 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.015..0.015 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 identities_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 = influencers_roles.influencer_id)
  • Filter: ((provider)::text = 'instagram'::text)
  • Rows Removed by Filter: 1
23. 9.356 9.356 ↑ 1.0 1 2,339

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

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

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

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