Skip to content

Migrate mentions for snippets

Number of rows affected

Snippets with mentions in description ~4646

explain select * from snippets where description like '%\@%'

Seq Scan on public.snippets  (cost=0.00..171832.75 rows=2874 width=4) (actual time=68.259..24192.167 rows=4646 loops=1)
   Filter: (snippets.description ~~ '%\@%'::text)
   Rows Removed by Filter: 228284
   Buffers: shared hit=35721 read=57920 dirtied=1580 written=33782
   I/O Timings: read=18417.080 write=3927.010

Snippet notes with mentions ~2434

  explain select id from notes where noteable_type = Snippet and note like %\@%

Index Scan using index_notes_on_noteable_id_and_noteable_type on public.notes  (cost=0.57..4505261.29 rows=3905 width=4) (actual time=20.952..1033201.721 rows=2434 loops=1)
   Index Cond: ((notes.noteable_type)::text = 'Snippet'::text)
   Filter: (notes.note ~~ '%\@%'::text)
   Rows Removed by Filter: 21718
   Buffers: shared hit=2531 read=1384974 dirtied=377
   I/O Timings: read=1018298.862
Edited by 🤖 GitLab Bot 🤖