Borrowing from Alex King’s Simple SQL Queries for Blog Stats, here’s some stats on this blog.
- The first post “It’s alive!” was made on 31st May 2003, some nine years ago.
- There have been 1,572 posts.
- On average, there are around 160 posts a year.
- Most posts are comfortably over 1000 characters long.
- The average post is about 170 words long; the longest is currently FOSDEM 2011: Saturday, and the shortest is This week’s addiction (whatever happened to…)
- There’s been an inexorable move toward fewer, longer posts in the last few years.
- These stats don’t include this post. I’ll leave that madness to xkcd.
Meta meta…
Here’s some useful queries for getting blog stats from a WordPress database.
Get first and last post:
select min(post_date) as start, max(post_date) as end from wp_posts; +---------------------+---------------------+ | start | end | +---------------------+---------------------+ | 2003-05-31 10:35:11 | 2012-01-13 18:14:58 | +---------------------+---------------------+
Get number of posts:
select count(*) from `wp_posts` WHERE post_status='publish'; +----------+ | count(*) | +----------+ | 1572 | +----------+
Get number of posts per year:
select YEAR(post_date), count(*) from `wp_posts` WHERE post_status='publish' GROUP BY YEAR(post_date); +-----------------+----------+ | YEAR(post_date) | count(*) | +-----------------+----------+ | 2003 | 154 | | 2004 | 329 | | 2005 | 501 | | 2006 | 225 | | 2007 | 176 | | 2008 | 75 | | 2009 | 17 | | 2010 | 19 | | 2011 | 70 | | 2012 | 6 | +-----------------+----------+
Get average number of posts per year:
drop table if exists average_posts; create temporary table if not exists average_posts select YEAR(post_date) as Year, count(*) as Count from `wp_posts` WHERE post_status='publish' GROUP BY YEAR(post_date); select avg(Count) from average_posts; +------------+ | avg(Count) | +------------+ | 157.2000 | +------------+
Get average length of posts (in characters) per year:
SELECT YEAR(post_date), AVG(LENGTH(post_content)) FROM `wp_posts` WHERE post_status='publish' GROUP BY YEAR(post_date); +-----------------+---------------------------+ | YEAR(post_date) | AVG(LENGTH(post_content)) | +-----------------+---------------------------+ | 2003 | 1260.8182 | | 2004 | 1174.0729 | | 2005 | 1062.4770 | | 2006 | 1003.2622 | | 2007 | 1473.9489 | | 2008 | 1862.2267 | | 2009 | 3575.2941 | | 2010 | 3447.3158 | | 2011 | 6024.9000 | | 2012 | 8707.6667 | +-----------------+---------------------------+
Get average word count of posts per year:
drop table if exists word_counts; create temporary table if not exists word_counts SELECT `ID`, `post_date`, SUM( LENGTH(`post_content`) - LENGTH(REPLACE(`post_content`, ' ', ''))+1) AS 'Wordcount' FROM `wp_posts` WHERE `post_status`='publish' GROUP BY `ID` ORDER BY `post_date` DESC; SELECT YEAR(post_date), AVG(Wordcount) FROM `word_counts` GROUP BY YEAR(post_date); +-----------------+----------------+ | YEAR(post_date) | AVG(Wordcount) | +-----------------+----------------+ | 2003 | 148.3052 | | 2004 | 147.6809 | | 2005 | 112.4611 | | 2006 | 105.3289 | | 2007 | 161.6875 | | 2008 | 218.9600 | | 2009 | 451.3529 | | 2010 | 450.3158 | | 2011 | 673.8714 | | 2012 | 1017.6667 | +-----------------+----------------+