explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PIxw

Settings
# exclusive inclusive rows x rows loops node
1. 0.038 0.329 ↓ 0.0 0 1

Update on document_status updated_status (cost=53.28..78.75 rows=1 width=128) (actual time=0.329..0.329 rows=0 loops=1)

2. 0.007 0.291 ↑ 1.0 1 1

Nested Loop (cost=53.28..78.75 rows=1 width=128) (actual time=0.245..0.291 rows=1 loops=1)

3. 0.006 0.056 ↓ 3.0 3 1

Nested Loop (cost=0.70..26.09 rows=1 width=84) (actual time=0.037..0.056 rows=3 loops=1)

  • Join Filter: (updated_status.id = ds.id)
  • Rows Removed by Join Filter: 6
4. 0.017 0.017 ↑ 1.0 3 1

Index Scan using document_status_pr_constraint on document_status ds (cost=0.29..15.39 rows=3 width=38) (actual time=0.013..0.017 rows=3 loops=1)

  • Index Cond: (document_id = 12,576)
5. 0.007 0.033 ↓ 1.5 3 3

Materialize (cost=0.41..10.62 rows=2 width=54) (actual time=0.007..0.011 rows=3 loops=3)

6. 0.026 0.026 ↓ 1.5 3 1

Index Scan using usr_src_d_st_u_idx on document_status updated_status (cost=0.41..10.61 rows=2 width=54) (actual time=0.018..0.026 rows=3 loops=1)

  • Index Cond: ((src = 0) AND (document_id = 12,576))
7. 0.018 0.228 ↓ 0.0 0 3

Subquery Scan on tt (cost=52.59..52.63 rows=1 width=62) (actual time=0.076..0.076 rows=0 loops=3)

  • Filter: (((tt.is_csdr_sent = 1) AND (((tt.permission & '16'::bigint) = 0) OR (((tt.permission & '16'::bigint) <> 0) AND ((tt.manual_cdate IS NULL) OR (tt.manual_cdate < tt.cdate))))) OR ((tt.is_csdr = 0) AND (((tt.permission & '256'::bigint) = 0) OR (((tt.permission & '256'::bigint) <> 0) AND ((tt.manual_cdate IS NULL) OR (tt.manual_cdate < tt.cdate))))))
  • Rows Removed by Filter: 0
8. 0.006 0.210 ↑ 1.0 1 3

Unique (cost=52.59..52.59 rows=1 width=52) (actual time=0.069..0.070 rows=1 loops=3)

9. 0.012 0.204 ↑ 1.0 1 3

Sort (cost=52.59..52.59 rows=1 width=52) (actual time=0.068..0.068 rows=1 loops=3)

  • Sort Key: r.cdate DESC
  • Sort Method: quicksort Memory: 25kB
10. 0.011 0.192 ↑ 1.0 1 3

Nested Loop Anti Join (cost=2.00..52.58 rows=1 width=52) (actual time=0.060..0.064 rows=1 loops=3)

  • Join Filter: (re.resolution_id = r.id)
  • Rows Removed by Join Filter: 21
11. 0.002 0.123 ↑ 1.0 1 3

Nested Loop Anti Join (cost=1.72..45.93 rows=1 width=36) (actual time=0.038..0.041 rows=1 loops=3)

  • Join Filter: (r2.cdate > r.cdate)
12. 0.003 0.111 ↑ 1.0 1 3

Nested Loop Anti Join (cost=1.43..37.61 rows=1 width=36) (actual time=0.034..0.037 rows=1 loops=3)

  • Join Filter: (project.parent_id = r.id)
13. 0.006 0.102 ↑ 1.0 1 3

Nested Loop (cost=0.86..25.89 rows=1 width=36) (actual time=0.031..0.034 rows=1 loops=3)

14. 0.006 0.060 ↓ 2.0 2 3

Nested Loop (cost=0.57..18.57 rows=1 width=36) (actual time=0.017..0.020 rows=2 loops=3)

15. 0.030 0.030 ↑ 1.0 1 3

Index Scan using usr_ugid_idx on usr u (cost=0.29..8.31 rows=1 width=24) (actual time=0.010..0.010 rows=1 loops=3)

  • Index Cond: (id = ds.user_id)
  • Filter: (is_connected = 1)
16. 0.024 0.024 ↓ 2.0 2 3

Index Scan using res_docid_author_test_idx on resolution r (cost=0.29..10.25 rows=1 width=28) (actual time=0.006..0.008 rows=2 loops=3)

  • Index Cond: ((document_id = 12,576) AND (u.connection_date <= rdate))
  • Filter: (is_csdr_project = 0)
17. 0.036 0.036 ↓ 0.0 0 6

Index Only Scan using rt_userid_resid on resolution_to rt (cost=0.29..7.31 rows=1 width=16) (actual time=0.006..0.006 rows=0 loops=6)

  • Index Cond: ((user_id = ds.user_id) AND (resolution_id = r.id))
  • Heap Fetches: 2
18. 0.000 0.006 ↓ 0.0 0 2

Nested Loop Semi Join (cost=0.57..11.71 rows=1 width=16) (actual time=0.003..0.003 rows=0 loops=2)

19. 0.006 0.006 ↓ 0.0 0 2

Index Scan using res_docid_author_test_idx on resolution project (cost=0.29..8.02 rows=1 width=24) (actual time=0.003..0.003 rows=0 loops=2)

  • Index Cond: ((document_id = 12,576) AND (author = rt.user_id) AND (author = ds.user_id))
  • Filter: (is_draft = 1)
20. 0.000 0.000 ↓ 0.0 0

Index Only Scan using resolution_parent_id_idx on resolution result (cost=0.29..4.34 rows=3 width=8) (never executed)

  • Index Cond: (parent_id = project.id)
  • Heap Fetches: 0
21. 0.010 0.010 ↓ 0.0 0 2

Index Scan using resolution_document_id_author_on_not_project_idx on resolution r2 (cost=0.29..8.31 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=2)

  • Index Cond: ((document_id = 12,576) AND (author = ds.user_id))
  • Filter: (is_sp = 0)
22. 0.058 0.058 ↓ 7.8 31 2

Index Only Scan using "idx$$_61550007" on r_execution re (cost=0.28..6.60 rows=4 width=16) (actual time=0.012..0.029 rows=31 loops=2)

  • Index Cond: ((is_interim = 0) AND (author = rt.user_id) AND (author = ds.user_id))
  • Heap Fetches: 43
Planning time : 4.682 ms
Execution time : 0.479 ms