Today I've discovered incidentally, that count(*) is slightly faster than count(1) on PostgreSQL 9.3.5:
create table hmr(id serial, value real);
insert into hmr (value) select random()*10000000 from generate_series(1,10000000);
select count(1) from hmr; --731 msec
select count(*) from hmr; --661 msec
Used repeatedly, e.g. in a function, this can really add up and make a difference.
In the spectral contrast angle CTE from the previous post, it reduces runtime by two seconds or 24%.
I would have expected the constant to be faster than actually reading the row...