Re: [HACKERS] Reducing the size of BufferTag & remodeling forks

2016-04-21 Thread Andres Freund
On 2016-04-19 15:44:36 -0300, Alvaro Herrera wrote: > Andres Freund wrote: > > > I've actually changed course a bit and I'm trying something different: A > > two level structure. One hashtable that maps (RelFileNode, ForkNumber) > > to a 'open relation' data structure, and from there a radix tree

Re: [HACKERS] Reducing the size of BufferTag & remodeling forks

2016-04-19 Thread Alvaro Herrera
Andres Freund wrote: > I've actually changed course a bit and I'm trying something different: A > two level structure. One hashtable that maps (RelFileNode, ForkNumber) > to a 'open relation' data structure, and from there a radix tree over > just the block number. To avoid having to look up in th

Re: [HACKERS] Reducing the size of BufferTag & remodeling forks

2015-09-13 Thread Simon Riggs
On 12 September 2015 at 21:19, Andres Freund wrote: > On 2015-09-12 13:12:26 +0100, Simon Riggs wrote: > > Why do we have to do buffer lookups using the full buffer tag? > > We don't necessarily. > > > Why not just use (relNode, blockNum) and resolve hash collisions, if any? > > I tried that and

Re: [HACKERS] Reducing the size of BufferTag & remodeling forks

2015-09-12 Thread Andres Freund
On 2015-09-12 13:12:26 +0100, Simon Riggs wrote: > Why do we have to do buffer lookups using the full buffer tag? We don't necessarily. > Why not just use (relNode, blockNum) and resolve hash collisions, if any? I tried that and unfortunately it came out as a negative - the number of collision g

Re: [HACKERS] Reducing the size of BufferTag & remodeling forks

2015-09-12 Thread Simon Riggs
On 2 July 2015 at 14:36, Andres Freund wrote: > Hi, > > I've complained a number of times that our BufferTag is ridiculously > large: > typedef struct buftag > { > RelFileNode rnode; /* physical relation identifier */ > ForkNumber forkNum; > BlockNumber blockNum; /* bl

Re: [HACKERS] Reducing the size of BufferTag & remodeling forks

2015-07-03 Thread Andres Freund
On 2015-07-03 13:59:07 -0300, Alvaro Herrera wrote: > Andres Freund wrote: > > > 2) Replace relation forks, with the exception of the init fork which is > >special anyway, with separate relfilenodes. Stored in seperate > >columns in pg_class. > > Different AMs have different fork needs; f

Re: [HACKERS] Reducing the size of BufferTag & remodeling forks

2015-07-03 Thread Alvaro Herrera
Andres Freund wrote: > 2) Replace relation forks, with the exception of the init fork which is >special anyway, with separate relfilenodes. Stored in seperate >columns in pg_class. Different AMs have different fork needs; for heaps you want one main fork, one VM, one fsm. But for indexes

Re: [HACKERS] Reducing the size of BufferTag & remodeling forks

2015-07-02 Thread Andres Freund
On 2015-07-02 09:51:59 -0400, Tom Lane wrote: > Andres Freund writes: > > 1) Introduce a shared pg_relfilenode table. Every table, even > >shared/nailed ones, get an entry therein. It's there to make it > >possibly to uniquely allocate relfilenodes across databases & > >tablespaces. >

Re: [HACKERS] Reducing the size of BufferTag & remodeling forks

2015-07-02 Thread Tom Lane
Andres Freund writes: > 1) Introduce a shared pg_relfilenode table. Every table, even >shared/nailed ones, get an entry therein. It's there to make it >possibly to uniquely allocate relfilenodes across databases & >tablespaces. > 2) Replace relation forks, with the exception of the ini

[HACKERS] Reducing the size of BufferTag & remodeling forks

2015-07-02 Thread Andres Freund
Hi, I've complained a number of times that our BufferTag is ridiculously large: typedef struct buftag { RelFileNode rnode; /* physical relation identifier */ ForkNumber forkNum; BlockNumber blockNum; /* blknum relative to begin of reln */ } BufferTag; typedef struct Re