explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4zQLY

Settings
# exclusive inclusive rows x rows loops node
1. 0.031 957.613 ↑ 1.0 1 1

Aggregate (cost=6,586,801.49..6,586,801.50 rows=1 width=8) (actual time=957.613..957.613 rows=1 loops=1)

2. 39.735 957.582 ↑ 18.2 229 1

Index Scan using index_accounts_on_organization_id_and_sfdc_id on accounts (cost=0.11..6,586,799.41 rows=4,171 width=0) (actual time=0.086..957.582 rows=229 loops=1)

  • Index Cond: (organization_id = 42)
  • Filter: (((owner_sfdc_id)::text = ANY ('{0054A000009AXL4QAO,0054A000009XOFzQAO,0054A000009mf0UQAQ,0054A000009mn45QAA,0054A000009msWnQAI,0054A000009mpk8QAA,0054A0000096zqCQAQ,0054A000009kdiQQAQ,0054A0000096v1UQAQ,0054A0000097RT6QAM,0054A0000096v1FQAQ,005G0000002w15YIAQ}'::text[])) OR (alternatives: SubPlan 1 or hashed SubPlan 2))
3.          

SubPlan (for Index Scan)

4. 0.000 0.000 ↓ 0.0 0

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

5. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (account_id = accounts.id)
6. 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.87 rows=1 width=4) (never executed)

  • Index Cond: (person_id = people.id)
  • Filter: (user_id = ANY ('{48099,62359,51097,51846,52133,51848,28271,46358,9582,39628,34106,27846,1895}'::integer[]))
  • Heap Fetches: 0
7. 49.902 917.847 ↓ 1.2 280,409 1

Gather (cost=1,000.23..810,880.11 rows=231,170 width=4) (actual time=1.084..917.847 rows=280,409 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
8. 3.288 867.945 ↓ 1.0 140,204 2 / 2

Nested Loop (cost=0.23..786,763.11 rows=135,982 width=4) (actual time=0.225..867.945 rows=140,204 loops=2)

9. 232.002 232.002 ↓ 1.6 210,885 2 / 2

Parallel Index Scan using index_person_activities_on_user_id on person_activities person_activities_1 (cost=0.11..301,368.55 rows=135,982 width=4) (actual time=0.106..232.002 rows=210,885 loops=2)

  • Index Cond: (user_id = ANY ('{48099,62359,51097,51846,52133,51848,28271,46358,9582,39628,34106,27846,1895}'::integer[]))
10. 632.655 632.655 ↑ 1.0 1 421,770 / 2

Index Scan using people_pkey on people people_1 (cost=0.11..3.57 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=421,770)

  • Index Cond: (id = person_activities_1.person_id)
Planning time : 1.839 ms
Execution time : 970.367 ms