On 3/28/06, Jim C. Nasby <jnasby@pervasive.com> wrote:
> Heh, too quick on the send button...
>
> On Tue, Mar 28, 2006 at 09:42:51PM +0200, PFC wrote:
> Actually, it's entirely possible to do stuff like web counters, you just
> want to do it differently in PostgreSQL. Simply insert into a table
> every time you have a hit, and then roll that data up periodically.
>
> And using MyISAM is no panacea, either. Trying to keep a web counter in
> a MyISAM table means you'll serialize every web page on that counter
> update.
if you want raw speed, use a sequence for a hit-counter. sequences
are wonder-tools and very lightweight. Explain analyze for a sequence
nextval on my desktop box reports 47 microseconds. thats 200k
sequence updates/second. insert into a table (fsync off/cache write,
no keys) is not much slower.
PostgreSQL 8.1 saw a lot of performance improvements...but the most
important (and least publicized) is the reduced latency of simple
queries in high cache enviroments.
merlin