explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RZWs

Settings
# exclusive inclusive rows x rows loops node
1. 49,490.454 63,928.957 ↓ 109.0 218 1

Nested Loop (cost=3,109.14..5,650.82 rows=2 width=41) (actual time=7,877.727..63,928.957 rows=218 loops=1)

  • Join Filter: ((app_relation.metadata)::jsonb @? ((('$.processDefinitions[*].id ? (@ == '::text || (proc_def.id_)::text) || ')'::text))::jsonpath)
  • Rows Removed by Join Filter: 3432846
2. 65.961 8,002.925 ↓ 218.0 218 1

Hash Join (cost=3,109.14..4,575.46 rows=1 width=587) (actual time=7,874.645..8,002.925 rows=218 loops=1)

  • Hash Cond: (app_relation.model_id = model_history.id)
3. 63.594 63.594 ↓ 1.0 43,600 1

Seq Scan on app_relation (cost=0.00..1,302.86 rows=43,586 width=100) (actual time=0.023..63.594 rows=43,600 loops=1)

4. 2.066 7,873.370 ↓ 223.0 223 1

Hash (cost=3,109.13..3,109.13 rows=1 width=495) (actual time=7,873.368..7,873.370 rows=223 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 142kB
5. 3.439 7,871.304 ↓ 223.0 223 1

Nested Loop (cost=16.98..3,109.13 rows=1 width=495) (actual time=177.515..7,871.304 rows=223 loops=1)

6. 7,456.207 7,820.589 ↓ 37.2 223 1

Nested Loop (cost=16.69..3,012.42 rows=6 width=491) (actual time=177.477..7,820.589 rows=223 loops=1)

  • Join Filter: ((runtime_app.app_definition)::jsonb @? ((('$.models[*].id ? (@ == '::text || (model.id)::text) || ')'::text))::jsonpath)
  • Rows Removed by Join Filter: 203023
7. 6.346 6.346 ↑ 1.0 1,346 1

Seq Scan on model (cost=0.00..158.77 rows=1,377 width=467) (actual time=0.009..6.346 rows=1,346 loops=1)

8. 325.250 358.036 ↓ 30.2 151 1,346

Materialize (cost=16.69..2,612.68 rows=5 width=455) (actual time=0.002..0.266 rows=151 loops=1,346)

9. 1.335 32.786 ↓ 30.2 151 1

Nested Loop (cost=16.69..2,612.66 rows=5 width=455) (actual time=1.071..32.786 rows=151 loops=1)

10. 3.305 6.971 ↓ 1.0 153 1

Hash Join (cost=16.40..178.79 rows=151 width=459) (actual time=1.012..6.971 rows=153 loops=1)

  • Hash Cond: (app_model.id = runtime_app.model_id)
11. 2.761 2.761 ↑ 1.0 1,346 1

Seq Scan on model app_model (cost=0.00..158.77 rows=1,377 width=12) (actual time=0.005..2.761 rows=1,346 loops=1)

12. 0.535 0.905 ↓ 1.0 153 1

Hash (cost=14.51..14.51 rows=151 width=447) (actual time=0.902..0.905 rows=153 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 80kB
13. 0.370 0.370 ↓ 1.0 153 1

Seq Scan on runtime_app_def runtime_app (cost=0.00..14.51 rows=151 width=447) (actual time=0.018..0.370 rows=153 loops=1)

14. 24.480 24.480 ↑ 1.0 1 153

Index Scan using idx_proc_mod_history_proc on model_history app_model_history (cost=0.29..16.11 rows=1 width=20) (actual time=0.123..0.160 rows=1 loops=153)

  • Index Cond: (model_id = app_model.id)
  • Filter: ((app_model.version - 1) = version)
  • Rows Removed by Filter: 50
15. 47.276 47.276 ↑ 1.0 1 223

Index Scan using idx_proc_mod_history_proc on model_history (cost=0.29..16.11 rows=1 width=20) (actual time=0.198..0.212 rows=1 loops=223)

  • Index Cond: (model_id = model.id)
  • Filter: ((model.version - 1) = version)
  • Rows Removed by Filter: 65
16. 6,435.578 6,435.578 ↑ 1.0 15,748 218

Seq Scan on act_re_procdef proc_def (cost=0.00..641.69 rows=15,769 width=28) (actual time=0.012..29.521 rows=15,748 loops=218)

Planning time : 4.209 ms
Execution time : 63,930.056 ms