explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bn79

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 8,172.489 ↑ 1.0 20 1

Limit (cost=55,814,382.17..55,814,382.22 rows=20 width=737) (actual time=8,172.481..8,172.489 rows=20 loops=1)

2. 1,203.787 8,172.486 ↑ 333,966.0 20 1

Sort (cost=55,814,382.17..55,831,080.47 rows=6,679,319 width=737) (actual time=8,172.480..8,172.486 rows=20 loops=1)

  • Sort Key: projects.updated_at DESC, projects.id DESC
  • Sort Method: top-N heapsort Memory: 33kB
3. 6,968.142 6,968.699 ↑ 4.1 1,642,462 1

Seq Scan on projects (cost=0.00..55,636,647.89 rows=6,679,319 width=737) (actual time=1.076..6,968.699 rows=1,642,462 loops=1)

  • Filter: ((NOT pending_delete) AND ((alternatives: SubPlan 1 or hashed SubPlan 2) OR (visibility_level = ANY ('{10,20}'::integer[]))))
  • Rows Removed by Filter: 10082860
4.          

SubPlan (for Seq Scan)

5. 0.000 0.000 ↓ 0.0 0

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations (cost=0.56..4.58 rows=1 width=0) (never executed)

  • Index Cond: ((user_id = 1562869) AND (project_id = projects.id))
  • Heap Fetches: 0
6. 0.557 0.557 ↓ 12.0 2,094 1

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations project_authorizations_1 (cost=0.56..9.61 rows=174 width=4) (actual time=0.024..0.557 rows=2,094 loops=1)

  • Index Cond: (user_id = 1562869)
  • Heap Fetches: 96
Planning time : 0.461 ms
Execution time : 8,172.596 ms