explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YTqj

Settings
# exclusive inclusive rows x rows loops node
1. 0.167 18,958.741 ↓ 2.0 2 1

Nested Loop (cost=348.26..2,889.96 rows=1 width=28) (actual time=17,431.734..18,958.741 rows=2 loops=1)

  • Join Filter: (runtime_app.model_id = app_model.id)
2. 1,481.311 18,958.112 ↓ 7.0 7 1

Nested Loop (cost=347.98..2,889.64 rows=1 width=48) (actual time=17,431.636..18,958.112 rows=7 loops=1)

  • Join Filter: ((app_relation.metadata)::jsonb @? ((('$.processDefinitions[*].id ? (@ == '::text || (proc_def.id_)::text) || ')'::text))::jsonpath)
  • Rows Removed by Join Filter: 110201
3. 46.202 17,288.431 ↓ 7.0 7 1

Hash Join (cost=347.98..1,814.30 rows=1 width=112) (actual time=17,259.093..17,288.431 rows=7 loops=1)

  • Hash Cond: (app_relation.model_id = model_history.id)
4. 48.832 48.832 ↓ 1.0 43,589 1

Seq Scan on app_relation (cost=0.00..1,302.86 rows=43,586 width=100) (actual time=0.026..48.832 rows=43,589 loops=1)

5. 0.087 17,193.397 ↓ 7.0 7 1

Hash (cost=347.97..347.97 rows=1 width=28) (actual time=17,193.395..17,193.397 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 0.145 17,193.310 ↓ 7.0 7 1

Nested Loop (cost=64.74..347.97 rows=1 width=28) (actual time=1,957.873..17,193.310 rows=7 loops=1)

7. 123.811 17,192.885 ↓ 7.0 7 1

Nested Loop (cost=64.45..253.00 rows=1 width=32) (actual time=1,957.804..17,192.885 rows=7 loops=1)

  • Join Filter: ((runtime_app.app_definition)::jsonb @? ((('$.models[*].id ? (@ == '::text || (model.id)::text) || ')'::text))::jsonpath)
  • Rows Removed by Join Filter: 2716
8. 0.118 2.927 ↓ 7.0 7 1

Nested Loop (cost=64.45..88.86 rows=1 width=451) (actual time=1.948..2.927 rows=7 loops=1)

9. 0.179 2.692 ↓ 6.5 13 1

Nested Loop (cost=64.30..88.53 rows=2 width=12) (actual time=1.927..2.692 rows=13 loops=1)

10. 0.453 2.292 ↓ 6.5 13 1

Bitmap Heap Scan on model_history processDefinition_deployedApplication (cost=64.01..71.92 rows=2 width=8) (actual time=1.884..2.292 rows=13 loops=1)

  • Recheck Cond: ((name)::text ~~* '%test rela%'::text)
  • Rows Removed by Index Recheck: 8
  • Heap Blocks: exact=14
11. 1.839 1.839 ↓ 10.5 21 1

Bitmap Index Scan on idx_model_history_name (cost=0.00..64.01 rows=2 width=0) (actual time=1.838..1.839 rows=21 loops=1)

  • Index Cond: ((name)::text ~~* '%test rela%'::text)
12. 0.221 0.221 ↑ 1.0 1 13

Index Scan using pk_model_history on model_history app_model_history (cost=0.29..8.31 rows=1 width=20) (actual time=0.017..0.017 rows=1 loops=13)

  • Index Cond: (id = processDefinition_deployedApplication.id)
13. 0.117 0.117 ↑ 1.0 1 13

Index Scan using uniq_runtime_app_def_model on runtime_app_def runtime_app (cost=0.14..0.16 rows=1 width=439) (actual time=0.008..0.009 rows=1 loops=13)

  • Index Cond: (model_id = app_model_history.model_id)
14. 17,066.147 17,066.147 ↓ 2.0 389 7

Seq Scan on model (cost=0.00..157.74 rows=197 width=12) (actual time=31.010..2,438.021 rows=389 loops=7)

  • Filter: ((NOT (COALESCE(((model_editor_json)::jsonb #>> '{hidden}'::text[]), 'false'::text))::boolean) AND (model_type = 0))
  • Rows Removed by Filter: 950
15. 0.280 0.280 ↑ 1.0 1 7

Index Scan using idx_proc_mod_history_proc on model_history (cost=0.29..94.96 rows=1 width=20) (actual time=0.038..0.040 rows=1 loops=7)

  • Index Cond: (model_id = model.id)
  • Filter: ((model.version - 1) = version)
  • Rows Removed by Filter: 3
16. 188.370 188.370 ↑ 1.0 15,744 7

Seq Scan on act_re_procdef proc_def (cost=0.00..641.69 rows=15,769 width=28) (actual time=0.014..26.910 rows=15,744 loops=7)

17. 0.462 0.462 ↓ 0.0 0 7

Index Scan using pk_model on model app_model (cost=0.28..0.31 rows=1 width=12) (actual time=0.066..0.066 rows=0 loops=7)

  • Index Cond: (id = app_model_history.model_id)
  • Filter: (app_model_history.version = (version - 1))
  • Rows Removed by Filter: 1
Planning time : 8.442 ms
Execution time : 18,959.089 ms