explain.depesz.com

PostgreSQL's explain analyze made readable

Result: H4vg

Settings
# exclusive inclusive rows x rows loops node
1. 0.627 59.709 ↓ 276.0 276 1

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

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

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

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

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

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

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

5. 2.703 43.753 ↓ 2,339.0 2,339 1

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

6. 4.272 34.039 ↓ 2,337.0 2,337 1

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

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

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

8. 1.166 22.935 ↓ 2,358.0 2,358 1

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

9. 2.088 17.087 ↓ 780.3 2,341 1

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

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

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

11. 0.603 1.986 ↓ 29.5 3,987 1

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

12. 0.044 0.044 ↑ 1.0 1 1

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

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

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

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

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

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

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

Seq Scan on tags tags_1 (cost=0.00..2.92 rows=1 width=8) (actual time=0.047..0.051 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. 7.011 7.011 ↑ 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.003 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 : 19.382 ms