explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UJQ8

Settings
# exclusive inclusive rows x rows loops node
1. 9.283 11,790.891 ↓ 1.5 3 1

Nested Loop Left Join (cost=3,143.22..5,290.63 rows=2 width=165) (actual time=11,783.210..11,790.891 rows=3 loops=1)

  • Join Filter: ((app_relation.metadata)::jsonb @? ((('$.processDefinitions[*].id ? (@ == '::text || (proc_def.id_)::text) || ')'::text))::jsonpath)
  • Rows Removed by Join Filter: 647
2. 7.313 7.313 ↓ 1.5 3 1

Seq Scan on act_re_procdef proc_def (cost=0.00..681.11 rows=2 width=124) (actual time=7.279..7.313 rows=3 loops=1)

  • Filter: ((id_)::text ~~ 'a10082TestRelation%'::text)
  • Rows Removed by Filter: 15738
3. 1.413 11,774.295 ↓ 216.0 216 3

Materialize (cost=3,143.22..4,609.46 rows=1 width=133) (actual time=3,896.097..3,924.765 rows=216 loops=3)

4. 41.351 11,772.882 ↓ 216.0 216 1

Hash Join (cost=3,143.22..4,609.45 rows=1 width=133) (actual time=11,688.271..11,772.882 rows=216 loops=1)

  • Hash Cond: (app_relation.model_id = model_history.id)
5. 44.534 44.534 ↑ 1.0 43,580 1

Seq Scan on app_relation (cost=0.00..1,302.80 rows=43,580 width=100) (actual time=0.020..44.534 rows=43,580 loops=1)

6. 1.969 11,686.997 ↓ 221.0 221 1

Hash (cost=3,143.21..3,143.21 rows=1 width=41) (actual time=11,686.995..11,686.997 rows=221 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 24kB
7. 3.737 11,685.028 ↓ 221.0 221 1

Nested Loop (cost=16.93..3,143.21 rows=1 width=41) (actual time=226.265..11,685.028 rows=221 loops=1)

8. 8,341.733 11,633.997 ↓ 36.8 221 1

Nested Loop (cost=16.64..3,043.94 rows=6 width=37) (actual time=226.198..11,633.997 rows=221 loops=1)

  • Join Filter: ((runtime_app.app_definition)::jsonb @? ((('$.models[*].id ? (@ == '::text || (model.id)::text) || ')'::text))::jsonpath)
  • Rows Removed by Join Filter: 199290
9. 2,858.428 2,858.428 ↓ 1.0 1,339 1

Seq Scan on model (cost=0.00..171.04 rows=1,335 width=13) (actual time=0.588..2,858.428 rows=1,339 loops=1)

10. 407.771 433.836 ↓ 29.8 149 1,339

Materialize (cost=16.64..2,639.29 rows=5 width=455) (actual time=0.003..0.324 rows=149 loops=1,339)

11. 1.279 26.065 ↓ 29.8 149 1

Nested Loop (cost=16.64..2,639.27 rows=5 width=455) (actual time=1.196..26.065 rows=149 loops=1)

12. 3.162 6.968 ↓ 1.0 151 1

Hash Join (cost=16.35..174.22 rows=149 width=459) (actual time=1.137..6.968 rows=151 loops=1)

  • Hash Cond: (app_model.id = runtime_app.model_id)
13. 2.785 2.785 ↓ 1.0 1,339 1

Seq Scan on model app_model (cost=0.00..154.35 rows=1,335 width=12) (actual time=0.008..2.785 rows=1,339 loops=1)

14. 0.588 1.021 ↓ 1.0 151 1

Hash (cost=14.49..14.49 rows=149 width=447) (actual time=1.019..1.021 rows=151 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 80kB
15. 0.433 0.433 ↓ 1.0 151 1

Seq Scan on runtime_app_def runtime_app (cost=0.00..14.49 rows=149 width=447) (actual time=0.015..0.433 rows=151 loops=1)

16. 17.818 17.818 ↑ 1.0 1 151

Index Scan using idx_proc_mod_history_proc on model_history app_model_history (cost=0.29..16.53 rows=1 width=20) (actual time=0.106..0.118 rows=1 loops=151)

  • Index Cond: (model_id = app_model.id)
  • Filter: ((app_model.version - 1) = version)
  • Rows Removed by Filter: 51
17. 47.294 47.294 ↑ 1.0 1 221

Index Scan using idx_proc_mod_history_proc on model_history (cost=0.29..16.53 rows=1 width=20) (actual time=0.195..0.214 rows=1 loops=221)

  • Index Cond: (model_id = model.id)
  • Filter: ((model.version - 1) = version)
  • Rows Removed by Filter: 66
Planning time : 10.580 ms
Execution time : 11,791.289 ms