Re: [HACKERS] Bogus sizing parameters in some AllocSetContextCreate calls

2016-08-28 Thread Tomas Vondra
On 08/28/2016 04:59 PM, Tom Lane wrote: Tomas Vondra writes: I'm however pretty sure this will have absolutely no impact on profiles. Yeah, I do not believe that either. Also, I think that the intent of the existing code is to defend against bad parameters even

Re: [HACKERS] Bogus sizing parameters in some AllocSetContextCreate calls

2016-08-28 Thread Tom Lane
Tomas Vondra writes: > I'm however pretty sure this will have absolutely no impact on profiles. Yeah, I do not believe that either. Also, I think that the intent of the existing code is to defend against bad parameters even in non-assert builds. Which might argue

Re: [HACKERS] Bogus sizing parameters in some AllocSetContextCreate calls

2016-08-28 Thread Tomas Vondra
On 08/28/2016 04:41 PM, Tom Lane wrote: Robert Haas writes: Also, I think we ought to replace this code in aset.c: initBlockSize = MAXALIGN(initBlockSize); if (initBlockSize < 1024) initBlockSize = 1024; maxBlockSize = MAXALIGN(maxBlockSize);

Re: [HACKERS] Bogus sizing parameters in some AllocSetContextCreate calls

2016-08-28 Thread Tomas Vondra
On 08/28/2016 04:41 PM, Tom Lane wrote: Robert Haas writes: Also, I think we ought to replace this code in aset.c: initBlockSize = MAXALIGN(initBlockSize); if (initBlockSize < 1024) initBlockSize = 1024; maxBlockSize = MAXALIGN(maxBlockSize);

Re: [HACKERS] Bogus sizing parameters in some AllocSetContextCreate calls

2016-08-28 Thread Tom Lane
Robert Haas writes: > Also, I think we ought to replace this code in aset.c: > initBlockSize = MAXALIGN(initBlockSize); > if (initBlockSize < 1024) > initBlockSize = 1024; > maxBlockSize = MAXALIGN(maxBlockSize); > With this: >

Re: [HACKERS] Bogus sizing parameters in some AllocSetContextCreate calls

2016-08-28 Thread Robert Haas
On Sat, Aug 27, 2016 at 2:08 PM, Tom Lane wrote: > The standard calling pattern for AllocSetContextCreate is > > cxt = AllocSetContextCreate(parent, name, > ALLOCSET_DEFAULT_MINSIZE, >

Re: [HACKERS] Bogus sizing parameters in some AllocSetContextCreate calls

2016-08-27 Thread Tom Lane
Andres Freund writes: > On 2016-08-27 15:46:26 -0400, Tom Lane wrote: >> (Or in other words, the fact that "DefaultContextCreate" is spelled >> "AllocSetContextCreate" is a bit of a historical artifact, but I do >> not see why changing the spelling is a useful exercise.) >

Re: [HACKERS] Bogus sizing parameters in some AllocSetContextCreate calls

2016-08-27 Thread Andres Freund
On 2016-08-27 15:46:26 -0400, Tom Lane wrote: > (Or in other words, the fact that "DefaultContextCreate" is spelled > "AllocSetContextCreate" is a bit of a historical artifact, but I do > not see why changing the spelling is a useful exercise.) Well, if you're going through nearly all of the

Re: [HACKERS] Bogus sizing parameters in some AllocSetContextCreate calls

2016-08-27 Thread Tom Lane
Andres Freund writes: > On 2016-08-27 15:36:28 -0400, Tom Lane wrote: >> What is actually of interest, IMO, is making *some* contexts have a >> different allocator, and that is going to require case-by-case decisions >> anyway. A blanket switch seems completely useless to me.

Re: [HACKERS] Bogus sizing parameters in some AllocSetContextCreate calls

2016-08-27 Thread Andres Freund
On 2016-08-27 15:36:28 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2016-08-27 14:08:44 -0400, Tom Lane wrote: > >> Barring objection, I propose to make these changes in HEAD and 9.6. > > > I think we might also / instead want to think about replacing a lot of > >

Re: [HACKERS] Bogus sizing parameters in some AllocSetContextCreate calls

2016-08-27 Thread Tom Lane
Andres Freund writes: > On 2016-08-27 14:08:44 -0400, Tom Lane wrote: >> Barring objection, I propose to make these changes in HEAD and 9.6. > I think we might also / instead want to think about replacing a lot of > those AllocSetContextCreate with a wrapper function.

Re: [HACKERS] Bogus sizing parameters in some AllocSetContextCreate calls

2016-08-27 Thread Andres Freund
Hi, On 2016-08-27 14:08:44 -0400, Tom Lane wrote: > The standard calling pattern for AllocSetContextCreate is > Barring objection, I propose to make these changes in HEAD and 9.6. > I don't feel a great need to adjust the back branches --- although there > might be some argument for adding these

[HACKERS] Bogus sizing parameters in some AllocSetContextCreate calls

2016-08-27 Thread Tom Lane
The standard calling pattern for AllocSetContextCreate is cxt = AllocSetContextCreate(parent, name, ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); or for some