Never use TRIM in production
mrbooks2_development=# select count(*) as num, TRIM('www.' FROM anchors.host) as trimhost from anchors group by trimhost order by num desc limit 25;
num | trimhost
------+---------------------------
7750 | amazon.com
6187 | marginalrevolution.com
5259 | nytimes.com
4124 | twitter.com
2528 | en.wikipedia.org
2376 | ashingtonpost.com
1695 | bloomberg.com
1207 | nber.org
1198 | ft.com
1107 | google.com
940 | youtube.com
908 | econlog.econlib.org
884 | papers.ssrn.com
833 | theguardian.com
753 | economist.com
652 | online.wsj.com
604 | medium.com
543 | slate.com
522 | theatlantic.com
497 | sj.com
494 | guardian.co.uk
464 | krugman.blogs.nytimes.com
428 | bbc.com
419 | sciencedirect.com
393 | newyorker.com
(25 rows)
Another sneak peak into my side project