explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GbCT

Settings
# exclusive inclusive rows x rows loops node
1. 0.601 60.534 ↓ 276.0 276 1

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

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

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

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

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

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

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

5. 0.735 44.902 ↓ 2,339.0 2,339 1

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

6. 4.470 34.819 ↓ 2,337.0 2,337 1

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

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

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

8. 1.204 23.358 ↓ 2,358.0 2,358 1

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

9. 2.129 17.472 ↓ 780.3 2,341 1

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

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

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

11. 0.579 1.952 ↓ 29.5 3,987 1

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

12. 0.040 0.040 ↑ 1.0 1 1

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

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

  • Recheck Cond: (tag_id = tags.id)
  • Filter: ((taggable_type)::text = 'Influencer'::text)
  • Heap Blocks: exact=215
14. 0.133 0.133 ↓ 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.133..0.133 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.048 ↑ 1.0 1 1

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

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

Seq Scan on tags tags_1 (cost=0.00..2.92 rows=1 width=8) (actual time=0.043..0.046 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 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. 4.678 4.678 ↑ 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.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 identities_3 (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.820 ms