explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2g9K

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,269.28..178,686.78 rows=181 width=55) (actual rows= loops=)

2.          

CTE usr_from_dep

3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=487.42..3,813.63 rows=9,425 width=8) (actual rows= loops=)

4.          

CTE user_list

5. 0.000 0.000 ↓ 0.0

Recursive Union (cost=0.29..487.00 rows=731 width=67) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Index Scan using org_id_parentid_idx on org o1 (cost=0.29..8.30 rows=1 width=67) (actual rows= loops=)

  • Index Cond: (id = 486)
7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.41..46.41 rows=73 width=67) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

WorkTable Scan on user_list (cost=0.00..0.20 rows=10 width=12) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Index Only Scan using org_id_par_test3_idx on org o2 (cost=0.41..4.53 rows=7 width=63) (actual rows= loops=)

  • Index Cond: (parent_id = user_list.id)
10. 0.000 0.000 ↓ 0.0

CTE Scan on user_list ufd (cost=0.00..14.62 rows=731 width=8) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Index Only Scan using usr_orgid_id_idx on usr (cost=0.42..4.40 rows=13 width=16) (actual rows= loops=)

  • Index Cond: (org_id = ufd.id)
12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=455.08..165,227.42 rows=2,026 width=59) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Hash Join (cost=454.51..123,388.21 rows=10,336 width=54) (actual rows= loops=)

  • Hash Cond: (dc.executor = ue.id)
14. 0.000 0.000 ↓ 0.0

Nested Loop (cost=212.63..114,255.64 rows=2,343,287 width=48) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

HashAggregate (cost=212.06..214.06 rows=200 width=8) (actual rows= loops=)

  • Group Key: usr_from_dep.id
16. 0.000 0.000 ↓ 0.0

CTE Scan on usr_from_dep (cost=0.00..188.50 rows=9,425 width=8) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Index Scan using dc_executor_idx on document_control dc (cost=0.57..568.61 rows=160 width=40) (actual rows= loops=)

  • Index Cond: ((executor = usr_from_dep.id) AND (is_control = 1))
18. 0.000 0.000 ↓ 0.0

Hash (cost=204.61..204.61 rows=2,982 width=30) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Index Only Scan using "idx$$_727b0001" on usr ue (cost=0.42..204.61 rows=2,982 width=30) (actual rows= loops=)

  • Index Cond: (group_id = 7)
20. 0.000 0.000 ↓ 0.0

Index Scan using document_n_uniq_idx on document_n dn (cost=0.57..4.04 rows=1 width=29) (actual rows= loops=)

  • Index Cond: ((document_id = dc.document_id) AND (org_id = 7))
  • Filter: ((rdate >= '2018-10-04 00:00:00'::timestamp without time zone) AND (rdate <= '2019-10-03 00:00:00'::timestamp without time zone) AND (d_deleted = 0) AND (status = 8))
21. 0.000 0.000 ↓ 0.0

Index Scan using sys_c0014909 on resolution_to rt (cost=0.57..4.75 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = dc.resolution_to_id)
  • Filter: (another_control = 1)