explain.depesz.com

PostgreSQL's explain analyze made readable

Result: n3Fj : using union

Settings
# exclusive inclusive rows x rows loops node
1. 0.022 0.129 ↑ 30.2 60 1

HashAggregate (cost=102.19..120.32 rows=1,813 width=16) (actual time=0.121..0.129 rows=60 loops=1)

  • Group Key: submissions.assignment_id, submissions.user_id
2.          

CTE assignment_batch

3. 0.014 0.014 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.014..0.014 rows=1 loops=1)

4. 0.004 0.107 ↑ 30.2 60 1

Append (cost=0.57..93.11 rows=1,813 width=16) (actual time=0.067..0.107 rows=60 loops=1)

5. 0.005 0.044 ↓ 0.0 0 1

Nested Loop (cost=0.57..11.81 rows=8 width=16) (actual time=0.044..0.044 rows=0 loops=1)

6. 0.023 0.023 ↑ 1.0 1 1

CTE Scan on assignment_batch (cost=0.00..0.02 rows=1 width=4) (actual time=0.023..0.023 rows=1 loops=1)

7. 0.016 0.016 ↓ 0.0 0 1

Index Scan using rosser_cowboy_submissions_assignment_id_by_grading_period on submissions (cost=0.57..11.71 rows=8 width=16) (actual time=0.016..0.016 rows=0 loops=1)

  • Index Cond: ((assignment_id = assignment_batch.assignment_id) AND (grading_period_id = ANY ('{348,349}'::bigint[])))
8. 0.013 0.059 ↑ 30.1 60 1

Result (cost=0.58..63.18 rows=1,805 width=16) (actual time=0.023..0.059 rows=60 loops=1)

  • One-Time Filter: (now() > '2019-10-03 16:50:20+00'::timestamp with time zone)
9. 0.015 0.046 ↑ 30.1 60 1

Nested Loop (cost=0.58..63.18 rows=1,805 width=16) (actual time=0.018..0.046 rows=60 loops=1)

10. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on assignment_batch assignment_batch_1 (cost=0.00..0.02 rows=1 width=4) (actual time=0.000..0.000 rows=1 loops=1)

11. 0.031 0.031 ↑ 30.1 60 1

Index Only Scan using index_submissions_on_assignment_id_and_user_id on submissions submissions_1 (cost=0.57..45.10 rows=1,805 width=16) (actual time=0.011..0.031 rows=60 loops=1)

  • Index Cond: (assignment_id = assignment_batch_1.assignment_id)
  • Heap Fetches: 5
Planning time : 2.598 ms
Execution time : 0.802 ms