explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1ViU

Settings
# exclusive inclusive rows x rows loops node
1. 96.592 1,573.746 ↓ 22,148.0 22,148 1

Sort (cost=259,087.50..259,087.51 rows=1 width=715) (actual time=1,561.690..1,573.746 rows=22,148 loops=1)

  • Sort Key: t.created_at
  • Sort Method: external merge Disk: 18528kB
2. 181.813 1,477.154 ↓ 22,148.0 22,148 1

WindowAgg (cost=1,002.93..259,087.49 rows=1 width=715) (actual time=1,375.594..1,477.154 rows=22,148 loops=1)

3. 34.528 1,295.341 ↓ 22,148.0 22,148 1

Nested Loop Left Join (cost=1,002.93..259,087.45 rows=1 width=832) (actual time=10.583..1,295.341 rows=22,148 loops=1)

4. 32.341 1,172.221 ↓ 22,148.0 22,148 1

Nested Loop Left Join (cost=1,002.79..259,087.29 rows=1 width=791) (actual time=10.569..1,172.221 rows=22,148 loops=1)

5. 37.219 1,006.992 ↓ 22,148.0 22,148 1

Nested Loop Left Join (cost=1,002.38..259,086.86 rows=1 width=763) (actual time=10.548..1,006.992 rows=22,148 loops=1)

6. 31.681 881.181 ↓ 22,148.0 22,148 1

Nested Loop Left Join (cost=1,002.10..259,086.56 rows=1 width=679) (actual time=10.532..881.181 rows=22,148 loops=1)

7. 0.000 672.316 ↓ 22,148.0 22,148 1

Gather (cost=1,001.67..259,086.07 rows=1 width=85) (actual time=10.507..672.316 rows=22,148 loops=1)

  • Workers Planned: 7
  • Workers Launched: 7
8. 29.633 1,180.033 ↓ 2,768.0 2,768 8

Nested Loop Left Join (cost=1.67..258,085.97 rows=1 width=85) (actual time=3.044..1,180.033 rows=2,768 loops=8)

  • Filter: (ch.id IS NULL)
  • Rows Removed by Filter: 2
9. 907.468 1,150.391 ↑ 2.8 2,770 8

Nested Loop (cost=1.11..243,773.33 rows=7,647 width=85) (actual time=2.961..1,150.391 rows=2,770 loops=8)

10. 242.908 242.908 ↑ 1.2 56,149 8

Parallel Index Only Scan using tasks_id_type_is_deleted_index on tasks p (cost=0.56..136,875.48 rows=65,442 width=25) (actual time=0.359..242.908 rows=56,149 loops=8)

  • Index Cond: ((type = 'FOR_RESOLUTION'::text) AND (is_deleted = false))
  • Filter: (NOT is_deleted)
  • Heap Fetches: 14177
11. 0.015 0.015 ↓ 0.0 0 449,189

Index Scan using tasks_parent_id_type_is_deleted_index on tasks t (cost=0.56..1.62 rows=1 width=110) (actual time=0.015..0.015 rows=0 loops=449,189)

  • Index Cond: (((parent_id)::text = (p.id)::text) AND ((type)::text = 'RECIPIENT'::text) AND (is_deleted = false))
  • Filter: ((NOT draft) AND (NOT is_deleted) AND (NOT task_done) AND (recipient_user_id IS NULL))
  • Rows Removed by Filter: 1
12. 0.009 0.009 ↓ 0.0 0 22,164

Index Scan using tasks_parent_id_type_is_deleted_index on tasks ch (cost=0.56..1.76 rows=11 width=50) (actual time=0.009..0.009 rows=0 loops=22,164)

  • Index Cond: (((parent_id)::text = (t.id)::text) AND (is_deleted = false))
  • Filter: (NOT is_deleted)
13. 177.184 177.184 ↑ 1.0 1 22,148

Index Scan using documents_pkey on documents d (cost=0.42..0.49 rows=1 width=619) (actual time=0.008..0.008 rows=1 loops=22,148)

  • Index Cond: ((t.document_id)::text = (id)::text)
14. 88.592 88.592 ↑ 1.0 1 22,148

Index Scan using organizations_pkey on organizations db (cost=0.28..0.30 rows=1 width=109) (actual time=0.004..0.004 rows=1 loops=22,148)

  • Index Cond: ((d.db_id)::text = (id)::text)
15. 132.888 132.888 ↑ 1.0 1 22,148

Index Scan using users_pkey on users u (cost=0.41..0.43 rows=1 width=78) (actual time=0.006..0.006 rows=1 loops=22,148)

  • Index Cond: ((t.sender_user_id)::text = (id)::text)
16. 88.592 88.592 ↑ 1.0 1 22,148

Index Scan using document_types_pkey on document_types dt (cost=0.14..0.16 rows=1 width=91) (actual time=0.004..0.004 rows=1 loops=22,148)

  • Index Cond: ((d.type_id)::text = (id)::text)
Planning time : 4.462 ms
Execution time : 1,597.079 ms