explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gAoY

Settings
# exclusive inclusive rows x rows loops node
1. 0.310 5,175.063 ↑ 256.7 410 1

GroupAggregate (cost=144,699,920.27..144,700,393.96 rows=105,265 width=29) (actual time=5,174.704..5,175.063 rows=410 loops=1)

  • Group Key: accounts.id
2. 0.886 5,174.753 ↑ 256.7 410 1

Sort (cost=144,699,920.27..144,699,972.90 rows=105,265 width=21) (actual time=5,174.698..5,174.753 rows=410 loops=1)

  • Sort Key: accounts.id
  • Sort Method: quicksort Memory: 57kB
3. 4,995.724 5,173.867 ↑ 256.7 410 1

Index Scan using index_accounts_on_organization_id_and_sfdc_id on accounts (cost=0.11..144,698,164.06 rows=105,265 width=21) (actual time=220.609..5,173.867 rows=410 loops=1)

  • Index Cond: (organization_id = 2,920)
  • Filter: ((lower(lower((name)::text)) ~~* '%%'::text) AND ((alternatives: SubPlan 1 or hashed SubPlan 2) OR ((sfdc_data ->> ''::text) = '0052R000009yNODQA2'::text)))
  • Rows Removed by Filter: 221,829
4.          

SubPlan (for Index Scan)

5. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.23..688.79 rows=1 width=0) (never executed)

6. 0.000 0.000 ↓ 0.0 0

Index Scan using index_people_on_account_id on people (cost=0.11..332.66 rows=165 width=4) (never executed)

  • Index Cond: (account_id = accounts.id)
7. 0.000 0.000 ↓ 0.0 0

Index Only Scan using index_person_activities_on_person_id_and_user_id on person_activities (cost=0.11..2.16 rows=1 width=4) (never executed)

  • Index Cond: ((person_id = people.id) AND (user_id = 61,036))
  • Heap Fetches: 0
8. 6.007 178.143 ↑ 4.6 1,855 1

Gather (cost=1,079.52..32,841.58 rows=8,574 width=4) (actual time=15.604..178.143 rows=1,855 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
9. 0.832 172.136 ↑ 5.8 618 3 / 3

Nested Loop (cost=79.52..30,984.18 rows=3,572 width=4) (actual time=11.697..172.136 rows=618 loops=3)

10. 144.806 149.662 ↑ 5.8 618 3 / 3

Parallel Bitmap Heap Scan on person_activities person_activities_1 (cost=79.40..16,370.74 rows=3,572 width=4) (actual time=11.523..149.662 rows=618 loops=3)

  • Recheck Cond: (user_id = 61,036)
  • Heap Blocks: exact=486
11. 4.856 4.856 ↑ 4.6 1,855 1 / 3

Bitmap Index Scan on index_person_activities_on_user_id (cost=0.00..78.97 rows=8,574 width=0) (actual time=14.567..14.567 rows=1,855 loops=1)

  • Index Cond: (user_id = 61,036)
12. 21.642 21.642 ↑ 1.0 1 1,855 / 3

Index Scan using people_pkey on people people_1 (cost=0.11..4.09 rows=1 width=8) (actual time=0.035..0.035 rows=1 loops=1,855)

  • Index Cond: (id = person_activities_1.person_id)
Planning time : 4.114 ms
Execution time : 5,175.632 ms