jolicode / qotd

MIT License
30 stars 4 forks source link

More features #39

Closed lyrixx closed 1 year ago

lyrixx commented 1 year ago

About performance of the search engine. I have 100K elements in the DB.

Word that match the first query: consequatur. Time: 57.02ms Explain:

Limit  (cost=17776.41..17778.16 rows=15 width=298)
  ->  Gather Merge  (cost=17776.41..20046.67 rows=19458 width=298)
        Workers Planned: 2
        ->  Sort  (cost=16776.39..16800.71 rows=9729 width=298)
              Sort Key: (ts_rank(message_ts, websearch_to_tsquery('consequatur'::text))) DESC
              ->  Parallel Bitmap Heap Scan on qotd q  (cost=225.21..16537.69 rows=9729 width=298)
                    Recheck Cond: (message_ts @@ websearch_to_tsquery('consequatur'::text))
                    ->  Bitmap Index Scan on qotd_message_ts  (cost=0.00..219.38 rows=23350 width=0)
                          Index Cond: (message_ts @@ websearch_to_tsquery('consequatur'::text))

Word that doesn't match the first query: consequat. Time: 650ms Explain:

Limit  (cost=12675.83..12675.87 rows=15 width=298)
  ->  Sort  (cost=12675.83..12741.49 rows=26263 width=298)
        Sort Key: (word_similarity(message, 'consequat'::text)) DESC, date DESC
        ->  Bitmap Heap Scan on qotd q  (cost=335.54..12031.48 rows=26263 width=298)
              Recheck Cond: (message ~~* '%consequat%'::text)
              ->  Bitmap Index Scan on qotd_message_trigram  (cost=0.00..328.97 rows=26263 width=0)
                    Index Cond: (message ~~* '%consequat%'::text)

About image preview : image


About new stats:

image