explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JY7S

Settings
# exclusive inclusive rows x rows loops node
1. 0.082 0.745 ↓ 8.5 17 1

Sort (cost=13.23..13.24 rows=2 width=20) (actual time=0.739..0.745 rows=17 loops=1)

  • Sort Key: r0.id DESC
  • Sort Method: quicksort Memory: 26kB
2. 0.039 0.663 ↓ 8.5 17 1

Nested Loop (cost=8.55..13.22 rows=2 width=20) (actual time=0.486..0.663 rows=17 loops=1)

  • Join Filter: (r0.id = receipt_job_states.receipt_id)
3. 0.023 0.471 ↓ 8.5 17 1

Unique (cost=8.41..8.42 rows=2 width=16) (actual time=0.444..0.471 rows=17 loops=1)

4. 0.059 0.448 ↓ 8.5 17 1

Sort (cost=8.41..8.42 rows=2 width=16) (actual time=0.441..0.448 rows=17 loops=1)

  • Sort Key: receipt_job_states.receipt_id
  • Sort Method: quicksort Memory: 25kB
5. 0.039 0.389 ↓ 8.5 17 1

Nested Loop (cost=2.25..8.40 rows=2 width=16) (actual time=0.207..0.389 rows=17 loops=1)

6. 0.077 0.197 ↓ 8.5 17 1

Hash Join (cost=2.11..3.54 rows=2 width=8) (actual time=0.158..0.197 rows=17 loops=1)

  • Hash Cond: (receipt_job_states.job_id = jobs.id)
7. 0.062 0.062 ↑ 1.1 17 1

Seq Scan on receipt_job_states (cost=0.00..1.36 rows=18 width=16) (actual time=0.045..0.062 rows=17 loops=1)

  • Filter: (exit_code > 0)
  • Rows Removed by Filter: 15
8. 0.029 0.058 ↓ 2.0 2 1

Hash (cost=2.10..2.10 rows=1 width=8) (actual time=0.058..0.058 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.029 0.029 ↓ 2.0 2 1

Seq Scan on jobs (cost=0.00..2.10 rows=1 width=8) (actual time=0.015..0.029 rows=2 loops=1)

  • Filter: (project_id = 1)
  • Rows Removed by Filter: 3
10. 0.153 0.153 ↑ 1.0 1 17

Index Scan using receipts_pkey on receipts (cost=0.14..2.38 rows=1 width=8) (actual time=0.009..0.009 rows=1 loops=17)

  • Index Cond: (id = receipt_job_states.receipt_id)
  • Filter: (inserted_at >= '2019-01-01 00:00:00'::timestamp without time zone)
11. 0.153 0.153 ↑ 1.0 1 17

Index Scan using receipts_pkey on receipts r0 (cost=0.14..2.39 rows=1 width=20) (actual time=0.009..0.009 rows=1 loops=17)

  • Index Cond: (id = receipts.id)
  • Filter: ((inserted_at >= '2019-01-01 00:00:00'::timestamp without time zone) AND (inserted_at <= '2019-12-31 00:00:00'::timestamp without time zone) AND (project_id = 1))
Planning time : 3.628 ms
Execution time : 1.174 ms