Syndicate

Syndicate content

SEQUENCES

hi all -

i am wondering how many folks out there are using sequences for primary keys of tables? and have you run into issues, etc?
i don't really see a lot of material out there for them and the manual seems thin on it.

thanks much

I'm not a production DBA any more

Hi,

I can't really answer this in any kind of sensible way. And I don't think this forum is read by a large enough section of the DBA community that you will get a sample of a useful size. I know there are some people who do it and I've not heard of any issues.

However, I don't believe in using meaningful keys, so I'm not really sure what a sequence will give you that a serial or serial8 wouldn't - is there any reason why you're not using those?

sequences

thanks for the response. we use serial or integer now and store the next id in a field in one table. each of the tables has a corresponding row in the one table and fetches the next set of id's to use. sometimes this one table will get hit hard and it will experience locking issues. so there is some thought that sequences will eliminate this but i am not well-versed in sequences and what pitfalls may be there.

You store the next value in a

You store the next value in a table and that table has locking issues? I can't say I'm surprised.

Why do you not just use a normal serial?