explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VkZdZ

Settings
# exclusive inclusive rows x rows loops node
1. 17.916 881.439 ↓ 57.0 57 1

Unique (cost=5,246.88..5,247.01 rows=1 width=940) (actual time=862.577..881.439 rows=57 loops=1)

2.          

Initplan (forUnique)

3. 0.004 0.050 ↑ 1.0 1 1

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

4. 0.030 0.030 ↑ 1.0 1 1

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

  • Filter: ((delete_ts IS NULL) AND ((name)::text = 'odgs_duty'::text))
  • Rows Removed by Filter: 42
5. 0.016 0.016 ↑ 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.016..0.016 rows=1 loops=1)

  • Index Cond: ((user_id = '9ffc7a8f-f427-ff38-7808-ba4532aadb94'::uuid) AND (role_id = t8.id))
6. 67.077 863.473 ↓ 11,914.0 11,914 1

Sort (cost=5,235.95..5,235.95 rows=1 width=940) (actual time=862.575..863.473 rows=11,914 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: 3549kB
7. 73.131 796.396 ↓ 11,914.0 11,914 1

Nested Loop Left Join (cost=1.68..5,235.94 rows=1 width=940) (actual time=38.136..796.396 rows=11,914 loops=1)

  • Join Filter: (t4.proc_id = t5.id)
  • Rows Removed by Join Filter: 142968
  • Filter: (((t3.user_id = '9ffc7a8f-f427-ff38-7808-ba4532aadb94'::uuid) AND ((t5.code)::text = 'MarkupNew'::text)) OR $1)
8. 13.334 675.609 ↓ 11,914.0 11,914 1

Nested Loop Left Join (cost=1.68..5,234.58 rows=1 width=972) (actual time=38.051..675.609 rows=11,914 loops=1)

9. 58.416 650.361 ↓ 11,914.0 11,914 1

Nested Loop Left Join (cost=1.40..5,234.15 rows=1 width=691) (actual time=38.044..650.361 rows=11,914 loops=1)

  • Join Filter: (t9.type_id = t10.id)
  • Rows Removed by Join Filter: 107226
10. 242.268 556.203 ↓ 11,914.0 11,914 1

Nested Loop Left Join (cost=1.40..5,232.93 rows=1 width=281) (actual time=38.030..556.203 rows=11,914 loops=1)

  • Join Filter: (t3.proc_role_id = t4.id)
  • Rows Removed by Join Filter: 679098
11. 16.953 147.139 ↓ 11,914.0 11,914 1

Nested Loop (cost=1.40..5,229.62 rows=1 width=281) (actual time=37.968..147.139 rows=11,914 loops=1)

12. 5.387 67.354 ↓ 10,472.0 10,472 1

Nested Loop (cost=1.12..5,229.28 rows=1 width=96) (actual time=37.952..67.354 rows=10,472 loops=1)

13. 0.583 41.696 ↓ 699.0 699 1

Nested Loop (cost=0.70..5,228.75 rows=1 width=80) (actual time=37.925..41.696 rows=699 loops=1)

14. 0.648 39.813 ↓ 50.0 50 1

Nested Loop (cost=0.42..5,228.26 rows=1 width=32) (actual time=37.902..39.813 rows=50 loops=1)

15. 0.063 38.315 ↓ 50.0 50 1

Nested Loop (cost=0.00..5,220.07 rows=1 width=16) (actual time=37.816..38.315 rows=50 loops=1)

  • Join Filter: (t1.proc_id = t2.id)
16. 0.026 0.026 ↑ 1.0 1 1

Seq Scan on wf_proc t2 (cost=0.00..1.16 rows=1 width=16) (actual time=0.023..0.026 rows=1 loops=1)

  • Filter: ((delete_ts IS NULL) AND ((code)::text = 'MarkupNew'::text))
  • Rows Removed by Filter: 12
17. 38.226 38.226 ↑ 1.3 50 1

Seq Scan on wf_card t1 (cost=0.00..5,218.09 rows=65 width=32) (actual time=37.780..38.226 rows=50 loops=1)

  • Filter: ((delete_ts IS NULL) AND ((state)::text = ',OnMarkup,'::text) AND (card_type = 1))
  • Rows Removed by Filter: 120560
18. 0.850 0.850 ↑ 1.0 1 50

Index Only Scan using swemel_swemel_doc_pkey on swemel_swemel_doc t0 (cost=0.42..8.19 rows=1 width=16) (actual time=0.016..0.017 rows=1 loops=50)

  • Index Cond: (card_id = t1.id)
  • Heap Fetches: 50
19. 1.300 1.300 ↓ 2.3 14 50

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.013..0.026 rows=14 loops=50)

  • Index Cond: (card_id = t0.card_id)
  • Filter: ((delete_ts IS NULL) AND (delete_ts IS NULL))
  • Rows Removed by Filter: 0
20. 20.271 20.271 ↓ 15.0 15 699

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.010..0.029 rows=15 loops=699)

  • 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))
21. 62.832 62.832 ↑ 2.0 1 10,472

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

  • Index Cond: (card_id = t0.card_id)
  • Filter: (delete_ts IS NULL)
22. 166.796 166.796 ↑ 1.0 58 11,914

Seq Scan on wf_proc_role t4 (cost=0.00..2.58 rows=58 width=32) (actual time=0.003..0.014 rows=58 loops=11,914)

23. 35.742 35.742 ↑ 1.0 10 11,914

Seq Scan on wf_attachmenttype t10 (cost=0.00..1.10 rows=10 width=426) (actual time=0.001..0.003 rows=10 loops=11,914)

24. 11.914 11.914 ↓ 0.0 0 11,914

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=11,914)

  • Index Cond: (t9.version_of_id = id)
25. 47.656 47.656 ↑ 1.0 13 11,914

Seq Scan on wf_proc t5 (cost=0.00..1.13 rows=13 width=30) (actual time=0.001..0.004 rows=13 loops=11,914)

Planning time : 25.554 ms
Execution time : 881.892 ms