explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6yXJ

Settings
# exclusive inclusive rows x rows loops node
1. 84.759 1,540.724 ↓ 22,148.0 22,148 1

Sort (cost=259,091.09..259,091.10 rows=1 width=715) (actual time=1,529.924..1,540.724 rows=22,148 loops=1)

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

WindowAgg (cost=1,002.93..259,091.08 rows=1 width=715) (actual time=1,362.149..1,455.965 rows=22,148 loops=1)

3. 27.132 1,287.121 ↓ 22,148.0 22,148 1

Nested Loop Left Join (cost=1,002.93..259,091.04 rows=1 width=832) (actual time=11.936..1,287.121 rows=22,148 loops=1)

4. 28.449 1,171.397 ↓ 22,148.0 22,148 1

Nested Loop Left Join (cost=1,002.79..259,090.88 rows=1 width=791) (actual time=11.927..1,171.397 rows=22,148 loops=1)

5. 33.211 1,010.060 ↓ 22,148.0 22,148 1

Nested Loop Left Join (cost=1,002.38..259,090.45 rows=1 width=763) (actual time=11.905..1,010.060 rows=22,148 loops=1)

6. 4.028 888.257 ↓ 22,148.0 22,148 1

Nested Loop Left Join (cost=1,002.10..259,090.15 rows=1 width=679) (actual time=11.893..888.257 rows=22,148 loops=1)

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

Gather (cost=1,001.67..259,089.66 rows=1 width=85) (actual time=11.869..707.045 rows=22,148 loops=1)

  • Workers Planned: 7
  • Workers Launched: 7
8. 29.390 1,178.846 ↓ 2,768.0 2,768 8

Nested Loop Left Join (cost=1.67..258,089.56 rows=1 width=85) (actual time=4.587..1,178.846 rows=2,768 loops=8)

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

Nested Loop (cost=1.11..243,776.74 rows=7,647 width=85) (actual time=4.566..1,149.447 rows=2,770 loops=8)

10. 249.419 249.419 ↑ 1.2 56,153 8

Parallel Index Only Scan using tasks_id_type_is_deleted_index on tasks p (cost=0.56..136,878.48 rows=65,442 width=25) (actual time=0.070..249.419 rows=56,153 loops=8)

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

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,223)

  • 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: ((id)::text = (t.document_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: ((id)::text = (d.db_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: ((id)::text = (t.sender_user_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: ((id)::text = (d.type_id)::text)
Planning time : 4.399 ms
Execution time : 1,579.819 ms