explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ricn

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 633.898 ↓ 0.0 0 1

ModifyTable on public.ci_job_artifacts (cost=8,344.66..205,895.86 rows=1 width=12) (actual time=633.898..633.898 rows=0 loops=1)

  • Buffers: shared hit=254,617
2. 149.264 633.895 ↓ 0.0 0 1

Nested Loop Semi Join (cost=8,344.66..205,895.86 rows=1 width=12) (actual time=633.895..633.895 rows=0 loops=1)

  • Buffers: shared hit=254,617
3. 477.475 484.631 ↓ 4,461.6 249,851 1

Index Scan using i6 on public.ci_job_artifacts (cost=8,344.24..205,702.82 rows=56 width=10) (actual time=9.973..484.631 rows=249,851 loops=1)

  • Filter: ((NOT (hashed SubPlan 1)) AND ((ci_job_artifacts.file_type = 10) OR (ci_job_artifacts.file_type = 101)) AND ((ci_job_artifacts.file_type = 10) OR (ci_job_artifacts.file_type = 101)))
  • Rows Removed by Filter: 1,000
  • Buffers: shared hit=254,617
4.          

SubPlan (for Index Scan)

5. 0.475 7.156 ↓ 1,000.0 1,000 1

Group (cost=8,343.81..8,343.82 rows=1 width=8) (actual time=6.561..7.156 rows=1,000 loops=1)

  • Group Key: ci_job_artifacts_2.id
  • Buffers: shared hit=4,069
6. 0.790 6.681 ↓ 1,000.0 1,000 1

Sort (cost=8,343.81..8,343.82 rows=1 width=8) (actual time=6.557..6.681 rows=1,000 loops=1)

  • Sort Key: ci_job_artifacts_2.id
  • Sort Method: quicksort Memory: 71kB
  • Buffers: shared hit=4,069
7. 0.484 5.891 ↓ 1,000.0 1,000 1

Nested Loop (cost=837.97..8,343.80 rows=1 width=8) (actual time=2.058..5.891 rows=1,000 loops=1)

  • Buffers: shared hit=4,069
8. 0.911 2.407 ↑ 11.9 1,000 1

HashAggregate (cost=837.55..956.08 rows=11,853 width=4) (actual time=2.019..2.407 rows=1,000 loops=1)

  • Group Key: ci_job_artifacts_3.job_id
  • Buffers: shared hit=124
9. 1.496 1.496 ↑ 11.9 1,000 1

Index Only Scan using i6 on public.ci_job_artifacts ci_job_artifacts_3 (cost=0.42..807.92 rows=11,854 width=4) (actual time=0.170..1.496 rows=1,000 loops=1)

  • Index Cond: ((ci_job_artifacts_3.job_id >= 121,896,538) AND (ci_job_artifacts_3.job_id < 156158378))
  • Heap Fetches: 20
  • Buffers: shared hit=124
10. 3.000 3.000 ↑ 1.0 1 1,000

Index Only Scan using i6 on public.ci_job_artifacts ci_job_artifacts_2 (cost=0.42..0.61 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=1,000)

  • Index Cond: (ci_job_artifacts_2.job_id = ci_job_artifacts_3.job_id)
  • Heap Fetches: 20
  • Buffers: shared hit=3,945
11. 0.000 0.000 ↓ 0.0 0 249,851

Index Scan using i6 on public.ci_job_artifacts ci_job_artifacts_1 (cost=0.42..3.39 rows=1 width=10) (actual time=0.000..0.000 rows=0 loops=249,851)

  • Index Cond: ((ci_job_artifacts_1.job_id = ci_job_artifacts.job_id) AND (ci_job_artifacts_1.job_id >= 121,896,538) AND (ci_job_artifacts_1.job_id < 156158378))
  • Filter: ((ci_job_artifacts_1.file_type = 10) OR (ci_job_artifacts_1.file_type = 101))
  • Rows Removed by Filter: 0