|
|
|
|
|
by kuschku
3554 days ago
|
|
> What happens if you search for a term that matches a lot of rows? This is the case where ts_rank is very expensive. I'd be curious to look at the explain of such a low-selectivity query. That’s actually quite unproblematic, if you have the tsvector as its own column (not just as index). It’s far more problematic to actually load that data from disk. |
|
Yes, it works, but it is slow because the tsvector is usually big enough to be stored in a TOAST table, and this produces a lot of random access reads.
This is why there is a project of storing additional information in the GIN (term positions) in order for the index to contain all necessary information for the ranking:
https://wiki.postgresql.org/images/2/25/Full-text_search_in_...