explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4HKL : Optimization for: plan #k7Uf

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=3,504.66..3,504.66 rows=1 width=4) (actual rows= loops=)

  • Sort Key: notes.id
2. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=12.84..3,504.65 rows=1 width=4) (actual rows= loops=)

  • Hash Cond: (notes.id = epic_user_mentions.note_id)
  • Filter: (epic_user_mentions.epic_id IS NULL)
3. 0.000 0.000 ↓ 0.0

Merge Join (cost=1.87..3,493.55 rows=33 width=4) (actual rows= loops=)

  • Merge Cond: (notes.noteable_id = epics.id)
4. 0.000 0.000 ↓ 0.0

Index Scan using index_notes_on_noteable_id_and_noteable_type on notes (cost=0.57..4,884,151.37 rows=11,441 width=8) (actual rows= loops=)

  • Index Cond: ((noteable_type)::text = 'Epic'::text)
  • Filter: ((note ~~ '%@%'::text) AND (id >= 67972855) AND (id < 268738059))
5. 0.000 0.000 ↓ 0.0

Index Only Scan using epics_pkey on epics (cost=0.29..463.48 rows=16,346 width=4) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Hash (cost=7.87..7.87 rows=248 width=8) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Index Only Scan using epic_user_mentions_on_epic_id_and_note_id_index on epic_user_mentions (cost=0.14..7.87 rows=248 width=8) (actual rows= loops=)