explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PdeP

Settings
# exclusive inclusive rows x rows loops node
1. 0.069 11,671.179 ↑ 162.1 232 1

GroupAggregate (cost=50,700,051.04..50,700,220.26 rows=37,604 width=12) (actual time=11,671.098..11,671.179 rows=232 loops=1)

  • Group Key: accounts.id
2. 0.499 11,671.110 ↑ 162.1 232 1

Sort (cost=50,700,051.04..50,700,069.84 rows=37,604 width=4) (actual time=11,671.093..11,671.110 rows=232 loops=1)

  • Sort Key: accounts.id
  • Sort Method: quicksort Memory: 35kB
3. 10,940.190 11,670.611 ↑ 162.1 232 1

Index Scan using index_accounts_on_organization_id_and_sfdc_id on accounts (cost=0.11..50,699,479.51 rows=37,604 width=4) (actual time=931.230..11,670.611 rows=232 loops=1)

  • Index Cond: (organization_id = 2,006)
  • Filter: ((lower(lower((name)::text)) ~~* '%%'::text) AND (((owner_sfdc_id)::text = '0053X000008d9r4QAA'::text) OR (alternatives: SubPlan 1 or hashed SubPlan 2)))
  • Rows Removed by Filter: 69,238
4.          

SubPlan (for Index Scan)

5. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.23..672.14 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..326.37 rows=162 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.13 rows=1 width=4) (never executed)

  • Index Cond: ((person_id = people.id) AND (user_id = 43,489))
  • Heap Fetches: 0
8. 1.956 730.421 ↓ 1.0 8,664 1

Gather (cost=1,079.02..31,663.06 rows=8,252 width=4) (actual time=61.319..730.421 rows=8,664 loops=1)

  • Workers Planned: 2
  • Workers Launched: 0
9. 3.889 728.465 ↓ 2.5 8,664 1

Nested Loop (cost=79.02..29,837.86 rows=3,438 width=4) (actual time=60.978..728.465 rows=8,664 loops=1)

10. 136.855 196.072 ↓ 2.5 8,664 1

Parallel Bitmap Heap Scan on person_activities person_activities_1 (cost=78.90..15,771.11 rows=3,438 width=4) (actual time=60.877..196.072 rows=8,664 loops=1)

  • Recheck Cond: (user_id = 43,489)
  • Heap Blocks: exact=6,801
11. 59.217 59.217 ↓ 1.0 8,664 1

Bitmap Index Scan on index_person_activities_on_user_id (cost=0.00..78.49 rows=8,252 width=0) (actual time=59.217..59.217 rows=8,664 loops=1)

  • Index Cond: (user_id = 43,489)
12. 528.504 528.504 ↑ 1.0 1 8,664

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

  • Index Cond: (id = person_activities_1.person_id)
Planning time : 3.219 ms
Execution time : 11,671.659 ms