2600 times performance jump !

Very useful but slow ts_stat() function, which gathers words statistics from tsvectors, will be surprisingly fast in 8.4. I tested dataset with geonames, total 5793013 rows with 2404197 unique names, CVS HEAD. I used query

=# select * into ts_stat2 from ts_stat('select fts from spots');

Before it takes 66405972.737 ms, now - only 25506.736 ms ! Very nice !

Enabling using internal data type in aggregate provides machinery for this win.