explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VKmp

Settings
# exclusive inclusive rows x rows loops node
1. 17.507 877.403 ↓ 49.0 49 1

Unique (cost=5,249.24..5,249.37 rows=1 width=1,330) (actual time=858.826..877.403 rows=49 loops=1)

2.          

Initplan (forUnique)

3. 0.005 0.074 ↑ 1.0 1 1

Nested Loop (cost=0.28..10.93 rows=1 width=0) (actual time=0.074..0.074 rows=1 loops=1)

4. 0.039 0.039 ↑ 1.0 1 1

Seq Scan on sec_role t8 (cost=0.00..2.62 rows=1 width=16) (actual time=0.039..0.039 rows=1 loops=1)

  • Filter: ((delete_ts IS NULL) AND ((name)::text = 'odgs_duty'::text))
  • Rows Removed by Filter: 42
5. 0.030 0.030 ↑ 1.0 1 1

Index Scan using idx_sec_user_role_uniq_role on sec_user_role t7 (cost=0.28..8.30 rows=1 width=16) (actual time=0.030..0.030 rows=1 loops=1)

  • Index Cond: ((user_id = '9ffc7a8f-f427-ff38-7808-ba4532aadb94'::uuid) AND (role_id = t8.id))
6. 68.048 859.822 ↓ 10,234.0 10,234 1

Sort (cost=5,238.31..5,238.31 rows=1 width=1,330) (actual time=858.824..859.822 rows=10,234 loops=1)

  • Sort Key: t1.id, t9.create_ts, t9.id, t9.attachment_type, t9.version, t9.created_by, t9.delete_ts, t9.deleted_by, t9.update_ts, t9.updated_by, t10.id, t10.version, t10.create_ts, t10.created_by, t10
  • Sort Method: quicksort Memory: 3103kB
7. 76.620 791.774 ↓ 10,234.0 10,234 1

Nested Loop Left Join (cost=1.68..5,238.30 rows=1 width=1,330) (actual time=42.507..791.774 rows=10,234 loops=1)

  • Join Filter: (t4.proc_id = t5.id)
  • Rows Removed by Join Filter: 122808
  • Filter: (((t3.user_id = '9ffc7a8f-f427-ff38-7808-ba4532aadb94'::uuid) AND ((t5.code)::text = 'MarkupNew'::text)) OR $1)
8. 17.014 674.218 ↓ 10,234.0 10,234 1

Nested Loop Left Join (cost=1.68..5,236.94 rows=1 width=1,362) (actual time=42.409..674.218 rows=10,234 loops=1)

9. 53.308 646.970 ↓ 10,234.0 10,234 1

Nested Loop Left Join (cost=1.40..5,236.51 rows=1 width=1,081) (actual time=42.404..646.970 rows=10,234 loops=1)

  • Join Filter: (t9.type_id = t10.id)
  • Rows Removed by Join Filter: 92106
10. 222.673 552.726 ↓ 10,234.0 10,234 1

Nested Loop Left Join (cost=1.40..5,235.29 rows=1 width=281) (actual time=42.387..552.726 rows=10,234 loops=1)

  • Join Filter: (t3.proc_role_id = t4.id)
  • Rows Removed by Join Filter: 583338
11. 21.136 166.309 ↓ 10,234.0 10,234 1

Nested Loop (cost=1.40..5,231.98 rows=1 width=281) (actual time=42.334..166.309 rows=10,234 loops=1)

12. 5.085 82.159 ↓ 9,002.0 9,002 1

Nested Loop (cost=1.12..5,231.64 rows=1 width=96) (actual time=42.312..82.159 rows=9,002 loops=1)

13. 1.865 53.635 ↓ 601.0 601 1

Nested Loop (cost=0.70..5,231.11 rows=1 width=80) (actual time=42.276..53.635 rows=601 loops=1)

  • Join Filter: (t1.proc_id = t2.id)
14. 0.609 46.361 ↓ 601.0 601 1

Nested Loop (cost=0.70..5,229.94 rows=1 width=96) (actual time=42.252..46.361 rows=601 loops=1)

15. 1.056 43.645 ↓ 43.0 43 1

Nested Loop (cost=0.42..5,229.45 rows=1 width=48) (actual time=42.227..43.645 rows=43 loops=1)

  • -> Index Only Scan using swemel_swemel_doc_pkey on swemel_swemel_doc t0 (cost=0.42..8.44 rows=1 width=16) (actual time=0.020..0.022 rows=1 loo
16. 42.589 42.589 ↓ 43.0 43 1

Seq Scan on wf_card t1 (cost=0.00..5,221.01 rows=1 width=32) (actual time=42.128..42.589 rows=43 loops=1)

  • Filter: ((delete_ts IS NULL) AND ((state)::text = ',OnMarkup,'::text) AND (card_type = 1))
  • Rows Removed by Filter: 120528
  • Index Cond: (card_id = t1.id)
  • Heap Fetches: 43
17. 2.107 2.107 ↓ 2.3 14 43

Index Scan using idx_wf_card_role_card on wf_card_role t3 (cost=0.28..0.43 rows=6 width=48) (actual time=0.027..0.049 rows=14 loops=43)

  • Index Cond: (card_id = t0.card_id)
  • Filter: ((delete_ts IS NULL) AND (delete_ts IS NULL))
  • Rows Removed by Filter: 0
18. 5.409 5.409 ↑ 1.0 1 601

Seq Scan on wf_proc t2 (cost=0.00..1.16 rows=1 width=16) (actual time=0.007..0.009 rows=1 loops=601)

  • Filter: ((delete_ts IS NULL) AND ((code)::text = 'MarkupNew'::text))
  • Rows Removed by Filter: 12
19. 23.439 23.439 ↓ 15.0 15 601

Index Scan using idx_ts_card_acl_wf_card on ts_card_acl t6 (cost=0.42..0.52 rows=1 width=16) (actual time=0.014..0.039 rows=15 loops=601)

  • Index Cond: (card_id = t0.card_id)
  • Filter: ((user_id = '9ffc7a8f-f427-ff38-7808-ba4532aadb94'::uuid) OR (organization_id = '19669de2-d5f7-9d78-d588-9d6ccf47a93d'::uuid))
20. 63.014 63.014 ↑ 2.0 1 9,002

Index Scan using idx_wf_attachment_card on wf_attachment t9 (cost=0.28..0.32 rows=2 width=233) (actual time=0.006..0.007 rows=1 loops=9,002)

  • Index Cond: (card_id = t0.card_id)
  • Filter: (delete_ts IS NULL)
21. 163.744 163.744 ↑ 1.0 58 10,234

Seq Scan on wf_proc_role t4 (cost=0.00..2.58 rows=58 width=32) (actual time=0.003..0.016 rows=58 loops=10,234)

22. 40.936 40.936 ↑ 1.0 10 10,234

Seq Scan on wf_attachmenttype t10 (cost=0.00..1.10 rows=10 width=816) (actual time=0.001..0.004 rows=10 loops=10,234)

23. 10.234 10.234 ↓ 0.0 0 10,234

Index Scan using wf_attachment_pkey on wf_attachment t11 (cost=0.28..0.41 rows=1 width=297) (actual time=0.001..0.001 rows=0 loops=10,234)

  • Index Cond: (t9.version_of_id = id)
24. 40.936 40.936 ↑ 1.0 13 10,234

Seq Scan on wf_proc t5 (cost=0.00..1.13 rows=13 width=30) (actual time=0.002..0.004 rows=13 loops=10,234)

Planning time : 29.463 ms
Execution time : 878.003 ms