explain.depesz.com

PostgreSQL's explain analyze made readable

Result: d33C

Settings
# exclusive inclusive rows x rows loops node
1. 0.181 2,538.477 ↓ 2.0 2 1

Nested Loop (cost=303.56..2,845.26 rows=1 width=28) (actual time=695.070..2,538.477 rows=2 loops=1)

  • Join Filter: (runtime_app.model_id = app_model.id)
2. 1,861.681 2,537.890 ↓ 7.0 7 1

Nested Loop (cost=303.29..2,844.94 rows=1 width=48) (actual time=694.943..2,537.890 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. 48.287 440.505 ↓ 7.0 7 1

Hash Join (cost=303.29..1,769.60 rows=1 width=112) (actual time=416.089..440.505 rows=7 loops=1)

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

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

5. 0.072 335.757 ↓ 7.0 7 1

Hash (cost=303.27..303.27 rows=1 width=28) (actual time=335.754..335.757 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 0.149 335.685 ↓ 7.0 7 1

Nested Loop (cost=64.74..303.27 rows=1 width=28) (actual time=42.257..335.685 rows=7 loops=1)

7. 309.624 335.242 ↓ 7.0 7 1

Nested Loop (cost=64.45..286.77 rows=1 width=32) (actual time=42.187..335.242 rows=7 loops=1)

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

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

9. 0.136 2.189 ↓ 6.5 13 1

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

10. 0.367 1.871 ↓ 6.5 13 1

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

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

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

  • Index Cond: ((name)::text ~~* '%test rela%'::text)
12. 0.182 0.182 ↑ 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.014..0.014 rows=1 loops=13)

  • Index Cond: (id = processDefinition_deployedApplication.id)
13. 0.104 0.104 ↑ 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.008 rows=1 loops=13)

  • Index Cond: (model_id = app_model_history.model_id)
14. 23.233 23.233 ↑ 1.0 1,339 7

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

15. 0.294 0.294 ↑ 1.0 1 7

Index Scan using idx_proc_mod_history_proc on model_history (cost=0.29..16.49 rows=1 width=20) (actual time=0.039..0.042 rows=1 loops=7)

  • Index Cond: (model_id = model.id)
  • Filter: ((model.version - 1) = version)
  • Rows Removed by Filter: 3
16. 235.704 235.704 ↑ 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.024..33.672 rows=15,744 loops=7)

17. 0.406 0.406 ↓ 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.058..0.058 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.887 ms
Execution time : 2,538.859 ms