Re: [HACKERS] Index Page Split logging

2008-01-02 Thread Gokulakannan Somasundaram
On Jan 2, 2008 2:25 AM, Simon Riggs [EMAIL PROTECTED] wrote: On Tue, 2008-01-01 at 14:02 -0500, Tom Lane wrote: Simon Riggs [EMAIL PROTECTED] writes: If we could log *only* the insert that caused the split, rather than the split itself, we would avoid that situation entirely. How

Re: [HACKERS] Index Page Split logging

2008-01-02 Thread Martijn van Oosterhout
On Wed, Jan 02, 2008 at 02:49:35PM +0530, Gokulakannan Somasundaram wrote: On Jan 2, 2008 2:25 AM, Simon Riggs [EMAIL PROTECTED] wrote: On Tue, 2008-01-01 at 14:02 -0500, Tom Lane wrote: How are you going to avoid the need to run user-defined functions (specifically, the btree comparison

Re: [HACKERS] Index Page Split logging

2008-01-02 Thread Gokulakannan Somasundaram
On Jan 2, 2008 3:35 PM, Martijn van Oosterhout [EMAIL PROTECTED] wrote: If the goal is to only store the insert, then we need to determine during recovery which page the record needs to be added to. To do this you need to go through the index, which can only be done by calling user-defined

Re: [HACKERS] Index Page Split logging

2008-01-02 Thread Martijn van Oosterhout
On Wed, Jan 02, 2008 at 04:04:48PM +0530, Gokulakannan Somasundaram wrote: On Jan 2, 2008 3:35 PM, Martijn van Oosterhout [EMAIL PROTECTED] wrote: If the goal is to only store the insert, then we need to determine during recovery which page the record needs to be added to. To do this you

Re: [HACKERS] Index Page Split logging

2008-01-02 Thread Gokulakannan Somasundaram
All indexes are done by user-defined functions, even b-trees. People can make their own b-tree indexes by defining an operator class. Note that user-defined is this case means anything called via the fmgr interface. Again, i think i have one more wrong understanding. My understanding is,

Re: [HACKERS] Index Page Split logging

2008-01-02 Thread Martijn van Oosterhout
On Wed, Jan 02, 2008 at 04:46:11PM +0530, Gokulakannan Somasundaram wrote: All indexes are done by user-defined functions, even b-trees. People can make their own b-tree indexes by defining an operator class. Note that user-defined is this case means anything called via the fmgr interface.

Re: [HACKERS] Index Page Split logging

2008-01-02 Thread Simon Riggs
On Wed, 2008-01-02 at 13:54 +0100, Martijn van Oosterhout wrote: On Wed, Jan 02, 2008 at 04:46:11PM +0530, Gokulakannan Somasundaram wrote: All indexes are done by user-defined functions, even b-trees. People can make their own b-tree indexes by defining an operator class. Note that

Re: [HACKERS] Index Page Split logging

2008-01-02 Thread Gokulakannan Somasundaram
On Jan 2, 2008 6:24 PM, Martijn van Oosterhout [EMAIL PROTECTED] wrote: On Wed, Jan 02, 2008 at 04:46:11PM +0530, Gokulakannan Somasundaram wrote: All indexes are done by user-defined functions, even b-trees. People can make their own b-tree indexes by defining an operator class. Note

Re: [HACKERS] Index Page Split logging

2008-01-02 Thread Martijn van Oosterhout
On Wed, Jan 02, 2008 at 01:17:03PM +, Simon Riggs wrote: That's right; shame I forgot this before I started the thread... Actually, I think your idea has merit, it's just not as easy as originally thought. All splits, including multiple-level splits, can be described as a sequence of split

[HACKERS] Index Page Split logging

2008-01-01 Thread Simon Riggs
When we split an index page we perform a multi-block operation that is both fairly expensive and complex to reconstruct should we crash partway through. If we could log *only* the insert that caused the split, rather than the split itself, we would avoid that situation entirely. This would then

Re: [HACKERS] Index Page Split logging

2008-01-01 Thread Tom Lane
Simon Riggs [EMAIL PROTECTED] writes: If we could log *only* the insert that caused the split, rather than the split itself, we would avoid that situation entirely. How are you going to avoid the need to run user-defined functions (specifically, the btree comparison functions) during replay?

Re: [HACKERS] Index Page Split logging

2008-01-01 Thread Simon Riggs
On Tue, 2008-01-01 at 14:02 -0500, Tom Lane wrote: Simon Riggs [EMAIL PROTECTED] writes: If we could log *only* the insert that caused the split, rather than the split itself, we would avoid that situation entirely. How are you going to avoid the need to run user-defined functions

Re: [HACKERS] Index Page Split logging

2008-01-01 Thread Martijn van Oosterhout
On Tue, Jan 01, 2008 at 08:55:58PM +, Simon Riggs wrote: On Tue, 2008-01-01 at 14:02 -0500, Tom Lane wrote: Simon Riggs [EMAIL PROTECTED] writes: If we could log *only* the insert that caused the split, rather than the split itself, we would avoid that situation entirely. How are

Re: [HACKERS] Index Page Split logging

2008-01-01 Thread Simon Riggs
On Tue, 2008-01-01 at 22:20 +0100, Martijn van Oosterhout wrote: On Tue, Jan 01, 2008 at 08:55:58PM +, Simon Riggs wrote: On Tue, 2008-01-01 at 14:02 -0500, Tom Lane wrote: Simon Riggs [EMAIL PROTECTED] writes: If we could log *only* the insert that caused the split, rather than the