explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qL8L : Title

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

Sort (cost=1,833.44..1,833.48 rows=16 width=301) (actual rows= loops=)

  • Sort Key: d.row_number
2. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=586.36..1,833.12 rows=16 width=301) (actual rows= loops=)

  • Hash Cond: (dog.document_id = d.id)
3. 0.000 0.000 ↓ 0.0

Seq Scan on document_og dog (cost=0.00..72.88 rows=2,888 width=37) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Hash (cost=586.16..586.16 rows=16 width=212) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Subquery Scan on d (cost=0.57..586.16 rows=16 width=212) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..586.00 rows=16 width=220) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

WindowAgg (cost=0.57..9,184.53 rows=251 width=220) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..9,180.77 rows=251 width=212) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Index Scan Backward using document_n_uniq_idx on document_n dn (cost=0.29..2,257.03 rows=335 width=57) (actual rows= loops=)

  • Index Cond: ((org_id = 2) AND (n = 0))
  • Filter: ((category >= 0) AND (category <> 6) AND (d_deleted = 0) AND (CASE WHEN ((num)::character varying IS NULL) THEN 0 ELSE 1 END = 1) AND ((cdate)::date >= '2020-01-14'::date) AND ((cdate)::date <= '2020-02-13'::date))
10. 0.000 0.000 ↓ 0.0

Index Scan using document_pk11118759906747_1_1 on document d_1 (cost=0.29..20.66 rows=1 width=155) (actual rows= loops=)

  • Index Cond: (id = dn.document_id)
  • Filter: ((alternatives: SubPlan 14 or hashed SubPlan 15) OR ((alternatives: SubPlan 16 or hashed SubPlan 17) AND (creator <> 76109185)) OR (prepared_by = 76109185))
11.          

SubPlan (for Index Scan)

12. 0.000 0.000 ↓ 0.0

Index Scan using document_user_access_pkey on document_user_access (cost=0.29..8.31 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((document_id = dn.document_id) AND (user_id = 76109185))
  • Filter: ('{1}'::integer[] && types)
13. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on document_user_access document_user_access_1 (cost=4.80..179.74 rows=30 width=8) (actual rows= loops=)

  • Recheck Cond: (user_id = 76109185)
  • Filter: ('{1}'::integer[] && types)
14. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on document_user_access_user_id_idx (cost=0.00..4.79 rows=67 width=0) (actual rows= loops=)

  • Index Cond: (user_id = 76109185)
15. 0.000 0.000 ↓ 0.0

Index Scan using document_user_access_pkey on document_user_access document_user_access_2 (cost=0.29..8.31 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((document_id = dn.document_id) AND (user_id = 76109185))
  • Filter: ('{2}'::integer[] && types)
16. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on document_user_access document_user_access_3 (cost=4.80..179.74 rows=24 width=8) (actual rows= loops=)

  • Recheck Cond: (user_id = 76109185)
  • Filter: ('{2}'::integer[] && types)
17. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on document_user_access_user_id_idx (cost=0.00..4.79 rows=67 width=0) (actual rows= loops=)

  • Index Cond: (user_id = 76109185)
18.          

SubPlan (for Hash Right Join)

19. 0.000 0.000 ↓ 0.0

Index Only Scan using r_sc_isproj_docid_id on resolution (cost=0.29..8.31 rows=1 width=0) (actual rows= loops=)

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

Index Only Scan using r_sc_isproj_docid_id on resolution resolution_1 (cost=0.29..12.12 rows=16 width=8) (actual rows= loops=)

  • Index Cond: ((special_control = 1) AND (is_project = 0))
21. 0.000 0.000 ↓ 0.0

Index Only Scan using dr_uid_did on document_read (cost=0.29..8.31 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((user_id = 76109185) AND (document_id = d.id))
22. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on document_read document_read_1 (cost=9.81..263.65 rows=197 width=8) (actual rows= loops=)

  • Recheck Cond: (user_id = 76109185)
23. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on dr_uid_did (cost=0.00..9.76 rows=197 width=0) (actual rows= loops=)

  • Index Cond: (user_id = 76109185)
24. 0.000 0.000 ↓ 0.0

Seq Scan on user_folder_document (cost=0.00..1.55 rows=1 width=0) (actual rows= loops=)

  • Filter: ((document_id = d.id) AND (user_id = 76109185))
25. 0.000 0.000 ↓ 0.0

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

  • Filter: (user_id = 76109185)
26. 0.000 0.000 ↓ 0.0

Index Only Scan using dib_document_id_idx on document_in_b (cost=0.27..8.42 rows=2 width=0) (actual rows= loops=)

  • Index Cond: (document_id = d.id)
27. 0.000 0.000 ↓ 0.0

Seq Scan on document_in_b document_in_b_1 (cost=0.00..8.33 rows=433 width=8) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

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

  • Filter: ((document_id = d.id) OR (in_document_id = d.id))
29. 0.000 0.000 ↓ 0.0

Limit (cost=0.29..10.12 rows=1 width=8) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Index Scan using document_n_uniq_idx on document_n (cost=0.29..10.12 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (document_id = d.id)
  • Filter: (medo_direction IS NOT NULL)
31. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..16.65 rows=1 width=0) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Index Scan using document_urgency_pk on document_urgency du (cost=0.28..8.32 rows=1 width=8) (actual rows= loops=)

  • 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))
33. 0.000 0.000 ↓ 0.0

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

  • Index Cond: ((id = du.user_id) AND (group_id = 2))
34. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,648.25..1,749.37 rows=19 width=8) (actual rows= loops=)

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

Seq Scan on document_urgency du_1 (cost=0.00..98.72 rows=919 width=16) (actual rows= loops=)

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

Hash (cost=1,637.77..1,637.77 rows=838 width=8) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Index Scan using quest_sx_idx611b3981b197b636e7 on usr u_1 (cost=0.29..1,637.77 rows=838 width=8) (actual rows= loops=)

  • Index Cond: (group_id = 2)
38. 0.000 0.000 ↓ 0.0

Limit (cost=0.73..17.02 rows=1 width=32) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.73..17.02 rows=1 width=32) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.43..16.47 rows=1 width=20) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Index Only Scan using "idx$$_760b000d" on covering_letter cl (cost=0.14..8.16 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (document_id = d.id)
42. 0.000 0.000 ↓ 0.0

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

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

Index Scan using sys_c0014946 on user_group ug (cost=0.29..0.54 rows=1 width=46) (actual rows= loops=)

  • Index Cond: (id = u_2.group_id)