explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Vt65

Settings
# exclusive inclusive rows x rows loops node
1. 1.205 5,705.128 ↓ 6,743.0 6,743 1

Unique (cost=9,094.08..9,094.09 rows=1 width=41) (actual time=5,703.363..5,705.128 rows=6,743 loops=1)

2. 10.983 5,703.923 ↓ 7,640.0 7,640 1

Sort (cost=9,094.08..9,094.08 rows=1 width=41) (actual time=5,703.363..5,703.923 rows=7,640 loops=1)

  • Sort Key: notes.discussion_id
  • Sort Method: quicksort Memory: 789kB
3. 1.056 5,692.940 ↓ 7,640.0 7,640 1

Nested Loop (cost=8,923.88..9,094.07 rows=1 width=41) (actual time=5,552.175..5,692.940 rows=7,640 loops=1)

4. 0.130 5,552.415 ↓ 9.2 341 1

Unique (cost=8,923.31..8,923.50 rows=37 width=4) (actual time=5,552.141..5,552.415 rows=341 loops=1)

5. 0.758 5,552.285 ↓ 10.8 401 1

Sort (cost=8,923.31..8,923.41 rows=37 width=4) (actual time=5,552.140..5,552.285 rows=401 loops=1)

  • Sort Key: notes_1.noteable_id
  • Sort Method: quicksort Memory: 43kB
6. 27.725 5,551.527 ↓ 10.8 401 1

Merge Join (cost=215.02..8,922.35 rows=37 width=4) (actual time=1,188.425..5,551.527 rows=401 loops=1)

  • Merge Cond: (notes_1.id = system_note_metadata.note_id)
7. 3,913.018 3,913.018 ↓ 3.1 78,005 1

Index Only Scan using notes_id_noteable_id_idx on notes notes_1 (cost=0.29..2,167.65 rows=24,821 width=8) (actual time=0.084..3,913.018 rows=78,005 loops=1)

  • Heap Fetches: 12488
8. 1,610.784 1,610.784 ↓ 1.0 273,226 1

Index Only Scan using system_note_metadata_note_id_idx on system_note_metadata (cost=0.42..6,035.55 rows=264,199 width=4) (actual time=0.022..1,610.784 rows=273,226 loops=1)

  • Heap Fetches: 9577
9. 139.469 139.469 ↓ 22.0 22 341

Index Scan using index_notes_on_noteable_id_and_noteable_type on notes (cost=0.57..4.59 rows=1 width=45) (actual time=0.069..0.409 rows=22 loops=341)

  • Index Cond: ((noteable_id = notes_1.noteable_id) AND ((noteable_type)::text = 'Epic'::text))
Planning time : 2.901 ms
Execution time : 5,720.625 ms