On Tue, Jan 31, 2017 at 12:15 AM, Peter Geoghegan <pg@bowt.ie> wrote:
>> Should this 64KB minimum be mentioned in the documentation?
>
> You mean user-visible documentation, and not just tuplesort.h? I don't
> think that that's necessary. That's a ludicrously low amount of memory
> for a worker to be limited to anyway. It will never come up with
> remotely sensible use of the feature.
I agree.
>> + if (!btspool->isunique)
>> + {
>> + shm_toc_estimate_keys(&pcxt->estimator, 2);
>> + }
>>
>> Project style: people always tell me to drop the curlies in cases like
>> that. There are a few more examples in the patch.
>
> I only do this when there is an "else" that must have curly braces,
> too. There are plenty of examples of this from existing code, so I
> think it's fine.
But I disagree on this one. I think
if (blah) stuff();
else
{ thing(); gargle();
}
...is much better than
if (blah)
{ stuff();
}
else
{ thing(); gargle();
}
But if there were a comment on a separate line before the call to
stuff(), then I would do it the second way.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company