explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PCGv

Settings
# exclusive inclusive rows x rows loops node
1. 37.731 327.157 ↓ 19.4 2,562 1

Sort (cost=706.05..706.38 rows=132 width=512) (actual time=310.619..327.157 rows=2,562 loops=1)

  • Sort Key: process_subprocessentity.deadline_at DESC, process_subprocess.name
  • Sort Method: quicksort Memory: 1,418kB
2. 35.690 289.426 ↓ 19.4 2,562 1

Hash Join (cost=403.77..701.40 rows=132 width=512) (actual time=98.000..289.426 rows=2,562 loops=1)

  • Hash Cond: (process_subprocess.main_process_id = process_mainprocess.id)
3. 35.718 238.289 ↓ 19.4 2,562 1

Hash Left Join (cost=365.57..662.86 rows=132 width=472) (actual time=82.527..238.289 rows=2,562 loops=1)

  • Hash Cond: (process_subprocess.category_id = process_category.id)
4. 93.998 201.145 ↓ 19.4 2,562 1

Hash Join (cost=361.35..658.27 rows=132 width=416) (actual time=81.071..201.145 rows=2,562 loops=1)

  • Hash Cond: (process_subprocessentity.subprocess_id = process_subprocess.id)
  • Join Filter: (((process_subprocessentity.deadline_at >= '2020-10-14 22:00:00+00'::timestamp with time zone) AND ((process_subprocess.routine -> 'type'::text) = '"daily"'::jsonb)) OR ((process_subprocessentity.deadline_at >= '2020-10-11 22:00:00+00'::timestamp with time zone) AND ((process_subprocess.routine -> 'type'::text) = '"weekly"'::jsonb)) OR ((process_subprocessentity.deadline_at >= '2020-09-30 22:00:00+00'::timestamp with time zone) AND ((process_subprocess.routine -> 'type'::text) = '"monthly"'::jsonb)) OR ((process_subprocessentity.deadline_at >= '2020-09-30 22:00:00+00'::timestamp with time zone) AND ((process_subprocess.routine -> 'type'::text) = '"quarterly"'::jsonb)) OR ((process_subprocessentity.deadline_at >= '2019-12-31 23:00:00+00'::timestamp with time zone) AND ((process_subprocess.routine -> 'type'::text) = '"annually"'::jsonb)) OR ((process_subprocess.routine -> 'type'::text) = '"once"'::jsonb))
  • Rows Removed by Join Filter: 2,532
5. 62.660 62.660 ↓ 1.0 8,794 1

Seq Scan on process_subprocessentity (cost=0.00..273.86 rows=8,787 width=267) (actual time=0.017..62.660 rows=8,794 loops=1)

  • Filter: (deadline_at < '2020-10-15 22:00:00+00'::timestamp with time zone)
  • Rows Removed by Filter: 3,195
6. 20.526 44.487 ↓ 33.6 2,590 1

Hash (cost=360.38..360.38 rows=77 width=149) (actual time=44.468..44.487 rows=2,590 loops=1)

  • Buckets: 4,096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 497kB
7. 23.961 23.961 ↓ 33.6 2,590 1

Index Scan using process_subprocess_organization_id_bed638d9 on process_subprocess (cost=0.28..360.38 rows=77 width=149) (actual time=0.056..23.961 rows=2,590 loops=1)

  • Index Cond: (organization_id = 9)
  • Filter: (is_active AND (((routine -> 'type'::text) = '"daily"'::jsonb) OR ((routine -> 'type'::text) = '"weekly"'::jsonb) OR ((routine -> 'type'::text) = '"monthly"'::jsonb) OR ((routine -> 'type'::text) = '"quarterly"'::jsonb) OR ((routine -> 'type'::text) = '"annually"'::jsonb) OR ((routine -> 'type'::text) = '"once"'::jsonb)))
8. 0.788 1.426 ↑ 1.0 99 1

Hash (cost=2.99..2.99 rows=99 width=56) (actual time=1.408..1.426 rows=99 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
9. 0.638 0.638 ↑ 1.0 99 1

Seq Scan on process_category (cost=0.00..2.99 rows=99 width=56) (actual time=0.017..0.638 rows=99 loops=1)

10. 7.996 15.447 ↑ 1.0 942 1

Hash (cost=26.42..26.42 rows=942 width=40) (actual time=15.429..15.447 rows=942 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 80kB
11. 7.451 7.451 ↑ 1.0 942 1

Seq Scan on process_mainprocess (cost=0.00..26.42 rows=942 width=40) (actual time=0.011..7.451 rows=942 loops=1)

Planning time : 3.081 ms
Execution time : 343.604 ms