explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gRNg

Settings
# exclusive inclusive rows x rows loops node
1. 1.183 110.499 ↓ 6,743.0 6,743 1

Unique (cost=9,094.08..9,094.09 rows=1 width=41) (actual time=108.753..110.499 rows=6,743 loops=1)

2. 10.541 109.316 ↓ 7,640.0 7,640 1

Sort (cost=9,094.08..9,094.08 rows=1 width=41) (actual time=108.751..109.316 rows=7,640 loops=1)

  • Sort Key: notes.discussion_id
  • Sort Method: quicksort Memory: 789kB
3. 0.861 98.775 ↓ 7,640.0 7,640 1

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

4. 0.055 88.707 ↓ 9.2 341 1

Unique (cost=8,923.31..8,923.50 rows=37 width=4) (actual time=88.583..88.707 rows=341 loops=1)

5. 0.139 88.652 ↓ 10.8 401 1

Sort (cost=8,923.31..8,923.41 rows=37 width=4) (actual time=88.582..88.652 rows=401 loops=1)

  • Sort Key: notes_1.noteable_id
  • Sort Method: quicksort Memory: 43kB
6. 21.098 88.513 ↓ 10.8 401 1

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

  • Merge Cond: (notes_1.id = system_note_metadata.note_id)
7. 33.426 33.426 ↓ 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.021..33.426 rows=78,005 loops=1)

  • Heap Fetches: 12488
8. 33.989 33.989 ↓ 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.019..33.989 rows=273,226 loops=1)

  • Heap Fetches: 9577
9. 9.207 9.207 ↓ 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.005..0.027 rows=22 loops=341)

  • Index Cond: ((noteable_id = notes_1.noteable_id) AND ((noteable_type)::text = 'Epic'::text))
Planning time : 0.539 ms
Execution time : 110.834 ms