Re: [GENERAL] SERIAL datatype

2008-08-26 Thread Zoltan Boszormenyi
Mark Roberts írta: On Mon, 2008-08-25 at 11:02 -0600, Scott Marlowe wrote: Well, of course a 64 bit int is gonna be bigger than a 32 bit, but with alignment issues and on 64 bit hardware, I'm guessing the difference isn't exactly twice as slow / twice as much storage. And it's way faster

Re: [GENERAL] SERIAL datatype

2008-08-25 Thread Mark Roberts
On Thu, 2008-08-21 at 13:53 -0600, Scott Marlowe wrote: Regular SERIAL type is limited to a 32 bit int. BIGSERIAL uses a 64 bit int. I think one of the things that would be offsetting is the size difference between the two types (32 vs 64 bits, 5 foreign keys, and a billion rows or so makes

Re: [GENERAL] SERIAL datatype

2008-08-25 Thread Scott Marlowe
On Mon, Aug 25, 2008 at 10:23 AM, Mark Roberts [EMAIL PROTECTED] wrote: On Thu, 2008-08-21 at 13:53 -0600, Scott Marlowe wrote: Regular SERIAL type is limited to a 32 bit int. BIGSERIAL uses a 64 bit int. I think one of the things that would be offsetting is the size difference between the

Re: [GENERAL] SERIAL datatype

2008-08-25 Thread Mark Roberts
On Mon, 2008-08-25 at 11:02 -0600, Scott Marlowe wrote: Well, of course a 64 bit int is gonna be bigger than a 32 bit, but with alignment issues and on 64 bit hardware, I'm guessing the difference isn't exactly twice as slow / twice as much storage. And it's way faster than a GUID which was

Re: [GENERAL] SERIAL datatype

2008-08-24 Thread Alban Hertroys
On Aug 21, 2008, at 9:51 PM, Peter Billen wrote: My concern is not that the table will become full, but that the sequence will be exhausted. Doing INSERT, DELETE, INSERT, DELETE ... will exhaust the sequence. What will happen then? Do I have to manually re-order my serial values and reset

Re: [GENERAL] SERIAL datatype

2008-08-22 Thread Sam Mason
On Thu, Aug 21, 2008 at 09:08:24PM +0200, Peter Billen wrote: Is it possible to insert a new entry? Will the serial sequence somehow be able to find the gap (3)? As others have said, no it's not going to. Sequences will only return values out of order when explicitly told to. The main reason

[GENERAL] SERIAL datatype

2008-08-21 Thread Peter Billen
Hi all, I would like to ask a question about the serial datatype. Say I have a field of type serial, and say for the sake of example that the range of a serial goes from 1 to 5 (inclusive). I insert 10 entries into the table, so the table is 'full': INSERT INTO my_table (my_serial) VALUES

Re: [GENERAL] SERIAL datatype

2008-08-21 Thread Peter Billen
Oops, my example was a bit incorrectly edited. I wanted to say that the range of a serial datatype goes from 1 to 5 (incluse) and I insert five entries (not 10). Peter Peter Billen schreef: Hi all, I would like to ask a question about the serial datatype. Say I have a field of type

Re: [GENERAL] SERIAL datatype

2008-08-21 Thread ries van Twisk
On Aug 21, 2008, at 2:23 PM, Peter Billen wrote: Oops, my example was a bit incorrectly edited. I wanted to say that the range of a serial datatype goes from 1 to 5 (incluse) and I insert five entries (not 10). Peter Peter Billen schreef: Hi all, I would like to ask a question about

Re: [GENERAL] SERIAL datatype

2008-08-21 Thread Peter Billen
My concern is not that the table will become full, but that the sequence will be exhausted. Doing INSERT, DELETE, INSERT, DELETE ... will exhaust the sequence. What will happen then? Do I have to manually re-order my serial values and reset the start sequence ID to MAX() + 1? Thanks in

Re: [GENERAL] SERIAL datatype

2008-08-21 Thread Scott Marlowe
On Thu, Aug 21, 2008 at 1:08 PM, Peter Billen [EMAIL PROTECTED] wrote: Hi all, I would like to ask a question about the serial datatype. Say I have a field of type serial, and say for the sake of example that the range of a serial goes from 1 to 5 (inclusive). I insert 5 (ed) entries into the

Re: [GENERAL] SERIAL datatype

2008-08-21 Thread Scott Marlowe
On Thu, Aug 21, 2008 at 1:51 PM, Peter Billen [EMAIL PROTECTED] wrote: My concern is not that the table will become full, but that the sequence will be exhausted. Doing INSERT, DELETE, INSERT, DELETE ... will exhaust the sequence. What will happen then? Do I have to manually re-order my serial

Re: [GENERAL] SERIAL datatype

2008-08-21 Thread Peter Billen
Thanks. I thought it was a bit counter-intuitive to have a BIGSERIAL while I will only have a few thousands of entries, which are updated (by DELETE and INSERT) constantly. Thanks Scott, Peter Scott Marlowe schreef: On Thu, Aug 21, 2008 at 1:08 PM, Peter Billen [EMAIL PROTECTED] wrote: