Re: Serials.

From: Dan Lyke <danlyke(at)flutterby(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Serials.
Date: 2001-03-25 02:28:08
Message-ID: 15037.22456.492634.743275@wynand.flutterby.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Grant writes:
> I have a message board. Where users can send each other messages. I
> doubt I will ever get 2147483647 messages, but I want to make sure I
> never get an error where the message isn't sent.

Think about loads. If your users are going to be posting 10
messages/second, that's 864000 messages per day, you won't wrap for
nearly 7 years. I've got a pretty heavy mail load, including spam I
probably get 300 messages/day, weekends are lighter, so if you've got
a bunch of weenies who are subscribed to a gazillion mailing lists
you're talking three thousand users for six and a half years.

A little light if you're planning on being the next Hotmail (A test
account set up there gets 70 spams/day without my ever publishing the
address), but for your average mid-range discussion forum you're
probably good for a while. I doubt that, say, Salon's TableTalk forum
gets even 10k new messages per day.

> I guess the best option is to create a function that changes all the
> ids to the lowest values possible and then set the sequence to the
> maximum value + 1.

Better idea, if one of your deletion criteria is going to be age,
would just be to wrap the IDs.

Dan

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-03-25 04:36:56 Re: all views in database broken at once
Previous Message Mathijs Brands 2001-03-25 00:57:04 Re: all views in database broken at once