explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eHRV

Settings
# exclusive inclusive rows x rows loops node
1. 0.307 17.095 ↑ 1.5 120 1

Nested Loop (cost=4,269.28..178,686.78 rows=181 width=55) (actual time=3.128..17.095 rows=120 loops=1)

2.          

CTE usr_from_dep

3. 0.007 0.050 ↑ 9,425.0 1 1

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

4.          

CTE user_list

5. 0.002 0.031 ↑ 731.0 1 1

Recursive Union (cost=0.29..487.00 rows=731 width=67) (actual time=0.016..0.031 rows=1 loops=1)

6. 0.015 0.015 ↑ 1.0 1 1

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

  • Index Cond: (id = 486)
7. 0.001 0.014 ↓ 0.0 0 1

Nested Loop (cost=0.41..46.41 rows=73 width=67) (actual time=0.014..0.014 rows=0 loops=1)

8. 0.001 0.001 ↑ 10.0 1 1

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

9. 0.012 0.012 ↓ 0.0 0 1

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

  • Index Cond: (parent_id = user_list.id)
  • Heap Fetches: 0
10. 0.032 0.032 ↑ 731.0 1 1

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

11. 0.011 0.011 ↑ 13.0 1 1

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

  • Index Cond: (org_id = ufd.id)
  • Heap Fetches: 0
12. 0.175 11.246 ↑ 12.4 163 1

Nested Loop (cost=455.08..165,227.42 rows=2,026 width=59) (actual time=3.074..11.246 rows=163 loops=1)

13. 0.127 5.003 ↑ 63.0 164 1

Hash Join (cost=454.51..123,388.21 rows=10,336 width=54) (actual time=3.005..5.003 rows=164 loops=1)

  • Hash Cond: (dc.executor = ue.id)
14. 0.114 2.001 ↑ 14,288.3 164 1

Nested Loop (cost=212.63..114,255.64 rows=2,343,287 width=48) (actual time=0.114..2.001 rows=164 loops=1)

15. 0.006 0.058 ↑ 200.0 1 1

HashAggregate (cost=212.06..214.06 rows=200 width=8) (actual time=0.057..0.058 rows=1 loops=1)

  • Group Key: usr_from_dep.id
16. 0.052 0.052 ↑ 9,425.0 1 1

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

17. 1.829 1.829 ↓ 1.0 164 1

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

  • Index Cond: ((executor = usr_from_dep.id) AND (is_control = 1))
18. 1.057 2.875 ↑ 1.0 2,846 1

Hash (cost=204.61..204.61 rows=2,982 width=30) (actual time=2.875..2.875 rows=2,846 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 226kB
19. 1.818 1.818 ↑ 1.0 2,846 1

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

  • Index Cond: (group_id = 7)
  • Heap Fetches: 9
20. 6.068 6.068 ↑ 1.0 1 164

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

  • 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))
  • Rows Removed by Filter: 0
21. 5.542 5.542 ↑ 1.0 1 163

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

  • Index Cond: (id = dc.resolution_to_id)
  • Filter: (another_control = 1)
  • Rows Removed by Filter: 0
Planning time : 7.501 ms
Execution time : 17.299 ms