Full-text search can handle a lot of data. To give end users more insights into their texts, PostgreSQL offers thepg_statfunction, which returns a list of words:
SELECT * FROM ts_stat('SELECT to_tsvector(''english'', comment) FROM pg_available_extensions') ORDER BY 2 DESC LIMIT 3; word | ndoc | nentry
----------+------+--------
function | 10 | 10
data | 10 | 10
type | 7 | 7
(3 rows)
Thewordcolumn contains the stemmed word,ndoctells us about the number of documents a certain word occurs.nentryindicates how often a word was found all together.