explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Cx2p

Settings
# exclusive inclusive rows x rows loops node
1. 11.083 10,424.146 ↓ 1.5 3 1

Nested Loop Left Join (cost=3,137.47..5,284.88 rows=2 width=165) (actual time=10,416.462..10,424.146 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. 6.924 6.924 ↓ 1.5 3 1

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

  • Filter: ((id_)::text ~~ 'a10082TestRelation%'::text)
  • Rows Removed by Filter: 15738
3. 1.900 10,406.139 ↓ 216.0 216 3

Materialize (cost=3,137.47..4,603.71 rows=1 width=133) (actual time=3,432.671..3,468.713 rows=216 loops=3)

4. 51.207 10,404.239 ↓ 216.0 216 1

Hash Join (cost=3,137.47..4,603.71 rows=1 width=133) (actual time=10,297.996..10,404.239 rows=216 loops=1)

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

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

6. 1.782 10,297.333 ↓ 221.0 221 1

Hash (cost=3,137.46..3,137.46 rows=1 width=41) (actual time=10,297.332..10,297.333 rows=221 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 24kB
7. 3.308 10,295.551 ↓ 221.0 221 1

Nested Loop (cost=16.93..3,137.46 rows=1 width=41) (actual time=253.297..10,295.551 rows=221 loops=1)

8. 7,320.769 10,250.253 ↓ 36.8 221 1

Nested Loop (cost=16.64..3,038.45 rows=6 width=37) (actual time=253.234..10,250.253 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,555.903 2,555.903 ↑ 1.0 1,339 1

Seq Scan on model (cost=0.00..171.13 rows=1,339 width=13) (actual time=0.553..2,555.903 rows=1,339 loops=1)

10. 346.635 373.581 ↓ 29.8 149 1,339

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

11. 1.339 26.946 ↓ 29.8 149 1

Nested Loop (cost=16.64..2,632.99 rows=5 width=455) (actual time=0.988..26.946 rows=149 loops=1)

12. 3.362 6.883 ↓ 1.0 151 1

Hash Join (cost=16.35..174.27 rows=149 width=459) (actual time=0.927..6.883 rows=151 loops=1)

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

Seq Scan on model app_model (cost=0.00..154.39 rows=1,339 width=12) (actual time=0.006..2.702 rows=1,339 loops=1)

14. 0.512 0.819 ↓ 1.0 151 1

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

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

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

16. 18.724 18.724 ↑ 1.0 1 151

Index Scan using idx_proc_mod_history_proc on model_history app_model_history (cost=0.29..16.49 rows=1 width=20) (actual time=0.110..0.124 rows=1 loops=151)

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

Index Scan using idx_proc_mod_history_proc on model_history (cost=0.29..16.49 rows=1 width=20) (actual time=0.172..0.190 rows=1 loops=221)

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