Re: Postgresql "FIFO" Tables, How-To ?
От | Thomas Kellerer |
---|---|
Тема | Re: Postgresql "FIFO" Tables, How-To ? |
Дата | |
Msg-id | bf67tb$1hm$1@main.gmane.org обсуждение исходный текст |
Ответ на | Re: Postgresql "FIFO" Tables, How-To ? (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-general |
Tom Lane schrieb: > Thomas Kellerer <spam_eater@gmx.net> writes: > >>But isn't that exactly the problem? Once the sequence wraps around how do I >>know that id=1 is actually later then id=2 without a date column? > > > If you use an int8 sequence column, I doubt you need to worry about > wraparound. A date column probably hasn't got enough resolution, > so the other workable approach is to use a timestamp column. Ends up > costing 8 bytes either way. > I'm aware of that, I was referring to Sean's comment: > The nifty thing about using a wrapping sequence is that the id's are > sequential across transactions, which correctly maps to the > progression of time, which obviates the need for relying on any kind > of a date column for doing syslog message ordering. If you only use the id, you can't really tell the message ordering by the ID as id=1 could well be inserted *after* id=2 due to the wrapping of the sequence Cheers Thomas
В списке pgsql-general по дате отправления: