Re: [HACKERS] Removing special case OID generation

2012-02-13 Thread Robert Haas
On Sat, Feb 11, 2012 at 4:23 AM, Simon Riggs si...@2ndquadrant.com wrote: Yeh, I was thinking we would do well to implement cached sequences for say first 1000 sequences. Another option might be to store all the sequences for a particular database in a single underlying data file. The current

Re: [HACKERS] Removing special case OID generation

2012-02-13 Thread Marti Raudsepp
On Mon, Feb 13, 2012 at 15:08, Robert Haas robertmh...@gmail.com wrote: Honestly, I think the biggest hassle of the OID code is not so much the way they're generated as the way they're stored within heap tuples.  I've wondered whether we should go through the system catalogs and replace all of

Re: [HACKERS] Removing special case OID generation

2012-02-13 Thread Robert Haas
On Mon, Feb 13, 2012 at 8:51 AM, Marti Raudsepp ma...@juffo.org wrote: On Mon, Feb 13, 2012 at 15:08, Robert Haas robertmh...@gmail.com wrote: Honestly, I think the biggest hassle of the OID code is not so much the way they're generated as the way they're stored within heap tuples.  I've

Re: [HACKERS] Removing special case OID generation

2012-02-13 Thread Andres Freund
On Monday, February 13, 2012 02:08:08 PM Robert Haas wrote: On Sat, Feb 11, 2012 at 4:23 AM, Simon Riggs si...@2ndquadrant.com wrote: Yeh, I was thinking we would do well to implement cached sequences for say first 1000 sequences. Another option might be to store all the sequences for a

Re: [HACKERS] Removing special case OID generation

2012-02-13 Thread Robert Haas
On Mon, Feb 13, 2012 at 9:41 AM, Andres Freund and...@anarazel.de wrote: On Monday, February 13, 2012 02:08:08 PM Robert Haas wrote: On Sat, Feb 11, 2012 at 4:23 AM, Simon Riggs si...@2ndquadrant.com wrote: Yeh, I was thinking we would do well to implement cached sequences for say first 1000

Re: [HACKERS] Removing special case OID generation

2012-02-13 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Another option might be to store all the sequences for a particular database in a single underlying data file. We've looked into that before, and found some roadblocks IIRC, though it probably isn't completely infeasible. See the archives.

Re: [HACKERS] Removing special case OID generation

2012-02-11 Thread Simon Riggs
On Fri, Feb 10, 2012 at 10:38 PM, Jim Nasby j...@nasby.net wrote: On 2/7/12 8:14 AM, Alvaro Herrera wrote: Having one sequence for each toast table could be wasteful though.  I mean, sequences are not the best use of shared buffer cache currently. If we could have more than one sequence data

Re: [HACKERS] Removing special case OID generation

2012-02-10 Thread Jim Nasby
On 2/7/12 8:14 AM, Alvaro Herrera wrote: Having one sequence for each toast table could be wasteful though. I mean, sequences are not the best use of shared buffer cache currently. If we could have more than one sequence data in a shared buffer page, things would be different. Not sure how

[HACKERS] Removing special case OID generation

2012-02-07 Thread Simon Riggs
Recent events have made me notice the OID handling. AFAICS, OIDs are just a sequence with a max value that fits in a uint. So ISTM that we should just strip out the OID handling code and just have a system sequence defined like this CREATE SEQUENCE _pg_oid MINVALUE 0 MAXVALUE 4294967296

Re: [HACKERS] Removing special case OID generation

2012-02-07 Thread Alvaro Herrera
Excerpts from Simon Riggs's message of mar feb 07 10:46:09 -0300 2012: Recent events have made me notice the OID handling. AFAICS, OIDs are just a sequence with a max value that fits in a uint. So ISTM that we should just strip out the OID handling code and just have a system sequence

Re: [HACKERS] Removing special case OID generation

2012-02-07 Thread Tom Lane
Simon Riggs si...@2ndquadrant.com writes: So ISTM that we should just strip out the OID handling code and just have a system sequence defined like this I think this is a pretty poor idea, because the overhead of nextval() is quite a lot larger than the overhead to get an OID.