explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JRbm

Settings
# exclusive inclusive rows x rows loops node
1. 87.932 1,865.425 ↓ 22,148.0 22,148 1

Sort (cost=502,629.47..502,629.48 rows=1 width=715) (actual time=1,855.673..1,865.425 rows=22,148 loops=1)

  • Sort Key: t.created_at
  • Sort Method: external merge Disk: 18520kB
2. 178.405 1,777.493 ↓ 22,148.0 22,148 1

WindowAgg (cost=1,002.93..502,629.46 rows=1 width=715) (actual time=1,679.579..1,777.493 rows=22,148 loops=1)

3. 26.893 1,599.088 ↓ 22,148.0 22,148 1

Nested Loop Left Join (cost=1,002.93..502,629.42 rows=1 width=832) (actual time=18.334..1,599.088 rows=22,148 loops=1)

4. 21.864 1,483.603 ↓ 22,148.0 22,148 1

Nested Loop Left Join (cost=1,002.79..502,629.26 rows=1 width=791) (actual time=18.322..1,483.603 rows=22,148 loops=1)

5. 30.605 1,328.851 ↓ 22,148.0 22,148 1

Nested Loop Left Join (cost=1,002.38..502,628.83 rows=1 width=763) (actual time=18.303..1,328.851 rows=22,148 loops=1)

6. 0.000 1,209.654 ↓ 22,148.0 22,148 1

Nested Loop Left Join (cost=1,002.10..502,628.53 rows=1 width=679) (actual time=18.290..1,209.654 rows=22,148 loops=1)

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

Gather (cost=1,001.67..502,628.03 rows=1 width=85) (actual time=18.265..1,113.165 rows=22,148 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
8. 45.523 1,500.540 ↓ 4,430.0 4,430 5

Nested Loop Left Join (cost=1.67..501,627.93 rows=1 width=85) (actual time=13.769..1,500.540 rows=4,430 loops=5)

  • Filter: (ch.id IS NULL)
  • Rows Removed by Filter: 4
9. 1,258.681 1,455.008 ↑ 3.0 4,433 5

Nested Loop (cost=1.11..476,612.80 rows=13,360 width=85) (actual time=13.746..1,455.008 rows=4,433 loops=5)

10. 196.314 196.314 ↑ 1.3 89,835 5

Parallel Index Scan using tasks_type_draft_is_active_is_deleted_due_date_index on tasks p (cost=0.56..289,709.22 rows=114,328 width=25) (actual time=0.070..196.314 rows=89,835 loops=5)

  • Index Cond: (((type)::text = 'FOR_RESOLUTION'::text) AND (is_deleted = false))
  • Filter: (NOT is_deleted)
11. 0.013 0.013 ↓ 0.0 0 449,177

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.013..0.013 rows=0 loops=449,177)

  • 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 : 3.942 ms
Execution time : 1,992.106 ms