explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5ZZV

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.009 2.080 ↓ 3.0 3 1

Sort (cost=304.95..304.95 rows=1 width=297) (actual time=2.079..2.080 rows=3 loops=1)

  • Sort Key: (dense_rank() OVER (?))
  • Sort Method: quicksort Memory: 25kB
2. 0.017 2.071 ↓ 3.0 3 1

Nested Loop Left Join (cost=233.10..304.94 rows=1 width=297) (actual time=1.897..2.071 rows=3 loops=1)

3. 0.001 1.768 ↓ 3.0 3 1

Limit (cost=232.82..232.84 rows=1 width=227) (actual time=1.761..1.768 rows=3 loops=1)

4. 0.014 1.767 ↓ 3.0 3 1

WindowAgg (cost=232.82..232.84 rows=1 width=227) (actual time=1.760..1.767 rows=3 loops=1)

5. 0.005 1.753 ↓ 3.0 3 1

Sort (cost=232.82..232.82 rows=1 width=219) (actual time=1.753..1.753 rows=3 loops=1)

  • Sort Key: dn.document_id DESC
  • Sort Method: quicksort Memory: 25kB
6. 0.004 1.748 ↓ 3.0 3 1

Nested Loop (cost=198.12..232.81 rows=1 width=219) (actual time=1.736..1.748 rows=3 loops=1)

7. 0.007 1.732 ↑ 1.3 3 1

Nested Loop (cost=197.84..230.81 rows=4 width=171) (actual time=1.726..1.732 rows=3 loops=1)

8. 0.004 1.719 ↑ 1.3 3 1

HashAggregate (cost=197.55..197.59 rows=4 width=8) (actual time=1.719..1.719 rows=3 loops=1)

  • Group Key: r.document_id
9. 0.000 1.715 ↑ 1.3 3 1

Nested Loop (cost=8.32..197.54 rows=4 width=8) (actual time=1.608..1.715 rows=3 loops=1)

10. 1.565 1.565 ↓ 3.8 15 1

Seq Scan on resolution r (cost=0.00..164.18 rows=4 width=16) (actual time=1.345..1.565 rows=15 loops=1)

  • Filter: (tags ? 'expedited_consideration'::text)
  • Rows Removed by Filter: 3598
11. 0.015 0.150 ↓ 0.0 0 15

Limit (cost=8.32..8.32 rows=1 width=16) (actual time=0.009..0.010 rows=0 loops=15)

12. 0.015 0.135 ↓ 0.0 0 15

Sort (cost=8.32..8.32 rows=1 width=16) (actual time=0.009..0.009 rows=0 loops=15)

  • Sort Key: rl.cdate DESC
  • Sort Method: quicksort Memory: 25kB
13. 0.120 0.120 ↓ 0.0 0 15

Index Scan using rlog_event_id_index on rlog rl (cost=0.28..8.31 rows=1 width=16) (actual time=0.007..0.008 rows=0 loops=15)

  • Index Cond: (event_id = 77)
  • Filter: ((obj_id = r.id) AND (user_id = 76108932) AND (extra = '1'::text))
  • Rows Removed by Filter: 25
14. 0.006 0.006 ↑ 1.0 1 3

Index Scan using document_pk11118759906747_1_1 on document d (cost=0.28..8.30 rows=1 width=163) (actual time=0.002..0.002 rows=1 loops=3)

  • Index Cond: (id = r.document_id)
15. 0.012 0.012 ↑ 1.0 1 3

Index Scan using document_n_uniq_idx on document_n dn (cost=0.29..0.49 rows=1 width=56) (actual time=0.004..0.004 rows=1 loops=3)

  • Index Cond: ((document_id = d.id) AND (org_id = 2))
  • Filter: ((category >= 0) AND (d_deleted = 0) AND (n_type = 0) AND (CASE WHEN ((num)::character varying IS NULL) THEN 0 ELSE 1 END = 1) AND (status = 8) AND ((cdate)::date >= '2019-07-08'::date) AND ((cdate)::date <= '2019-08-07'::date))
16. 0.006 0.006 ↓ 0.0 0 3

Index Scan using document_og_document_id_idx on document_og dog (cost=0.28..8.29 rows=1 width=26) (actual time=0.002..0.002 rows=0 loops=3)

  • Index Cond: (document_id = d.id)
17.          

SubPlan (for Nested Loop Left Join)

18. 0.009 0.009 ↓ 0.0 0 3

Index Only Scan using r_sc_isproj_docid_id on resolution (cost=0.28..8.30 rows=1 width=0) (actual time=0.003..0.003 rows=0 loops=3)

  • Index Cond: ((special_control = 1) AND (is_project = 0) AND (document_id = d.id))
  • Heap Fetches: 0
19. 0.000 0.000 ↓ 0.0 0

Index Only Scan using r_sc_isproj_docid_id on resolution resolution_1 (cost=0.28..15.40 rows=5 width=8) (never executed)

  • Index Cond: ((special_control = 1) AND (is_project = 0))
  • Heap Fetches: 0
20. 0.012 0.012 ↑ 1.0 1 3

Index Only Scan using dr_uid_did on document_read (cost=0.29..8.30 rows=1 width=0) (actual time=0.004..0.004 rows=1 loops=3)

  • Index Cond: ((user_id = 76108932) AND (document_id = d.id))
  • Heap Fetches: 3
21. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on document_read document_read_1 (cost=5.76..97.13 rows=190 width=8) (never executed)

  • Recheck Cond: (user_id = 76108932)
22. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on dr_uid_did (cost=0.00..5.71 rows=190 width=0) (never executed)

  • Index Cond: (user_id = 76108932)
23. 0.000 0.000 ↓ 0.0 0

Seq Scan on user_folder_document (cost=0.00..1.45 rows=1 width=0) (never executed)

  • Filter: ((document_id = d.id) AND (user_id = 76108932))
24. 0.007 0.007 ↑ 1.0 1 1

Seq Scan on user_folder_document user_folder_document_1 (cost=0.00..1.38 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=1)

  • Filter: (user_id = 76108932)
  • Rows Removed by Filter: 29
25. 0.063 0.063 ↓ 0.0 0 3

Seq Scan on document_in_b (cost=0.00..4.99 rows=2 width=0) (actual time=0.021..0.021 rows=0 loops=3)

  • Filter: (document_id = d.id)
  • Rows Removed by Filter: 239
26. 0.000 0.000 ↓ 0.0 0

Seq Scan on document_in_b document_in_b_1 (cost=0.00..4.39 rows=239 width=8) (never executed)

27. 0.138 0.138 ↓ 0.0 0 3

Seq Scan on document_in_d (cost=0.00..12.15 rows=3 width=0) (actual time=0.046..0.046 rows=0 loops=3)

  • Filter: ((document_id = d.id) OR (in_document_id = d.id))
  • Rows Removed by Filter: 417
28. 0.003 0.012 ↓ 0.0 0 3

Limit (cost=0.29..10.14 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=3)

29. 0.009 0.009 ↓ 0.0 0 3

Index Scan using document_n_uniq_idx on document_n (cost=0.29..10.14 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=3)

  • Index Cond: (document_id = d.id)
  • Filter: (medo_direction IS NOT NULL)
  • Rows Removed by Filter: 2
30. 0.000 0.006 ↓ 0.0 0 3

Nested Loop (cost=0.57..16.83 rows=1 width=0) (actual time=0.002..0.002 rows=0 loops=3)

31. 0.006 0.006 ↓ 0.0 0 3

Index Scan using du_docid_idx on document_urgency du (cost=0.28..8.50 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=3)

  • Index Cond: (document_id = d.id)
  • Filter: ((urgency > 0) OR (ceil(((date_part('day'::text, (exec_date - (CURRENT_DATE)::timestamp without time zone)))::integer)::double precision) <= '10'::double precision))
32. 0.000 0.000 ↓ 0.0 0

Index Only Scan using usr_ugid_idx on usr u (cost=0.29..8.31 rows=1 width=8) (never executed)

  • Index Cond: ((id = du.user_id) AND (group_id = 2))
  • Heap Fetches: 0
33. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=1,333.26..1,382.23 rows=7 width=8) (never executed)

  • Hash Cond: (du_1.user_id = u_1.id)
34. 0.000 0.000 ↓ 0.0 0

Seq Scan on document_urgency du_1 (cost=0.00..47.84 rows=433 width=16) (never executed)

  • Filter: ((urgency > 0) OR (ceil(((date_part('day'::text, (exec_date - (CURRENT_DATE)::timestamp without time zone)))::integer)::double precision) <= '10'::double precision))
35. 0.000 0.000 ↓ 0.0 0

Hash (cost=1,324.38..1,324.38 rows=710 width=8) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Index Scan using quest_sx_idx611b3981b197b636e7 on usr u_1 (cost=0.29..1,324.38 rows=710 width=8) (never executed)

  • Index Cond: (group_id = 2)
37. 0.000 0.033 ↓ 0.0 0 3

Limit (cost=0.58..12.21 rows=1 width=32) (actual time=0.011..0.011 rows=0 loops=3)

38. 0.003 0.033 ↓ 0.0 0 3

Nested Loop (cost=0.58..12.21 rows=1 width=32) (actual time=0.011..0.011 rows=0 loops=3)

39. 0.000 0.030 ↓ 0.0 0 3

Nested Loop (cost=0.29..11.66 rows=1 width=20) (actual time=0.010..0.010 rows=0 loops=3)

40. 0.030 0.030 ↓ 0.0 0 3

Seq Scan on covering_letter cl (cost=0.00..3.35 rows=1 width=8) (actual time=0.010..0.010 rows=0 loops=3)

  • Filter: (document_id = d.id)
  • Rows Removed by Filter: 108
41. 0.000 0.000 ↓ 0.0 0

Index Scan using usr_ugid_idx on usr u_2 (cost=0.29..8.31 rows=1 width=28) (never executed)

  • Index Cond: (id = cl.sign)
42. 0.000 0.000 ↓ 0.0 0

Index Scan using sys_c0014946 on user_group ug (cost=0.29..0.55 rows=1 width=46) (never executed)

  • Index Cond: (id = u_2.group_id)
Planning time : 4.650 ms
Execution time : 2.317 ms