explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uJ7Z

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 6,401.212 ↑ 1.0 20 1

Limit (cost=35,819,003.36..35,819,003.41 rows=20 width=589) (actual time=6,401.204..6,401.212 rows=20 loops=1)

  • Buffers: shared hit=329336
2. 1,269.371 6,401.209 ↑ 267,407.5 20 1

Sort (cost=35,819,003.36..35,832,373.73 rows=5,348,149 width=589) (actual time=6,401.203..6,401.209 rows=20 loops=1)

  • Sort Key: (GREATEST(COALESCE(projects.last_activity_at, '1970-01-01 00:00:00+00'::timestamp with time zone), (COALESCE(projects.last_repository_updated_at, '1970-01-01 00:00:00'::timestamp without time zone))::timestamp with time zone, projects.updated_at)) DESC
  • Sort Method: top-N heapsort Memory: 42kB
  • Buffers: shared hit=329336
3. 5,130.880 5,131.838 ↑ 4.1 1,291,139 1

Seq Scan on projects (cost=0.00..35,676,691.04 rows=5,348,149 width=589) (actual time=1.668..5,131.838 rows=1,291,139 loops=1)

  • Filter: ((NOT archived) AND ((alternatives: SubPlan 1 or hashed SubPlan 2) OR (visibility_level = ANY ('{10,20}'::integer[]))))
  • Rows Removed by Filter: 8264096
  • Buffers: shared hit=329336
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..3.58 rows=1 width=0) (never executed)

  • Index Cond: ((user_id = 64248) AND (project_id = projects.id))
  • Heap Fetches: 0
6. 0.958 0.958 ↑ 1.4 1,728 1

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations project_authorizations_1 (cost=0.56..63.51 rows=2,346 width=4) (actual time=0.043..0.958 rows=1,728 loops=1)

  • Index Cond: (user_id = 64248)
  • Heap Fetches: 92
  • Buffers: shared hit=619