explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Bb8n

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 0.059 ↑ 1.0 1 1

Limit (cost=5,390.15..5,392.63 rows=1 width=8) (actual time=0.058..0.059 rows=1 loops=1)

  • Output: s.sid
  • Buffers: shared hit=7
2.          

CTE _sessions

3. 0.045 0.045 ↑ 7,874.0 1 1

Index Scan using "sessions_pid_localeId_assignmentStartedFlag_assignmentCompl_idx" on project_2795.sessions (cost=0.43..5,389.72 rows=7,874 width=93) (actual time=0.045..0.045 rows=1 loops=1)

  • Output: sessions.sid, sessions.pid, sessions."localeId", sessions."sessionId", sessions."numAssignmentsRemaining", sessions."numAssignments", sessions."assignmentStartedFlag", sessions."assignmentCompletedFlag", sessions."numGradesTargeted", sessions."numGradesCompleted", sessions."numRequestsInSession", sessions."allGradesCompletedFlag", sessions."conflictFlag", sessions."completedDate", sessions.created, sessions."reviewStartedFlag", sessions."reviewCompletedFlag", sessions.upid
  • Index Cond: ((sessions.pid = 2795) AND (sessions."localeId" = 'en_US'::text) AND (sessions."assignmentCompletedFlag" = false))
  • Filter: (NOT sessions."assignmentCompletedFlag")
  • Buffers: shared hit=4
4. 0.002 0.058 ↑ 3,937.0 1 1

Nested Loop Anti Join (cost=0.43..9,761.55 rows=3,937 width=8) (actual time=0.058..0.058 rows=1 loops=1)

  • Output: s.sid
  • Buffers: shared hit=7
5. 0.046 0.046 ↑ 7,874.0 1 1

CTE Scan on _sessions s (cost=0.00..157.48 rows=7,874 width=8) (actual time=0.046..0.046 rows=1 loops=1)

  • Output: s.sid, s.pid, s."localeId", s."sessionId", s."numAssignmentsRemaining", s."numAssignments", s."assignmentStartedFlag", s."assignmentCompletedFlag", s."numGradesTargeted", s."numGradesCompleted", s."numRequestsInSession", s."allGradesCompletedFlag", s."conflictFlag", s."completedDate", s.created, s."reviewStartedFlag", s."reviewCompletedFlag", s.upid
  • Buffers: shared hit=4
6. 0.010 0.010 ↓ 0.0 0 1

Index Only Scan using test_index_for_anti_join_sa on project_2795.session_assignments sa (cost=0.43..1.21 rows=1 width=8) (actual time=0.010..0.010 rows=0 loops=1)

  • Output: sa.sid, sa.uid, sa."localeId
  • Index Cond: ((sa.sid = s.sid) AND (sa.uid = 1) AND (sa."localeId" = 'en_US'::text))
  • Heap Fetches: 0
  • Buffers: shared hit=3