[postgis-devel] Validity flag

Hugo Mercier hugo.mercier at oslandia.com
Fri Nov 16 00:39:42 PST 2018



On 15/11/2018 19:01, Paul Ramsey wrote:
> 
> 
>> On Nov 15, 2018, at 8:11 AM, Sandro Santilli <strk at kbt.io
>> <mailto:strk at kbt.io>> wrote:
>>
>> On Thu, Nov 15, 2018 at 04:26:56PM +0100, Hugo Mercier wrote:
>>>
>>>
>>> On 15/11/2018 11:55, Sandro Santilli wrote:
>>>
>>>>
>>>> I was asking just because I'm pretty sure we need more flagspace
>>>> for introducing validity. And we need NOT to consume all flags,
>>>> so that we can use the last available flag for specifying there
>>>> are more flags following it.
>>>>
>>>
>>> Are you suggesting a variable-length flags in postgis 3.0 header ?
>>> Each flag byte would have one bit that says "wait there is more" ?
>>
>> Yes, also known as the "extension bit”
> 
> So, this might be something we no longer care about, but the
> serialization we have was designed to land the double arrays on
> alignment boundaries, so it’s possible to directly read the values
> without copying them out into aligned storage. This may or may not have
> been a “big win”, since intel architectures allow unaligned reads (with
> a slight performance penalty) and most of our architectures are intel,
> but some architectures like RISC do not allow unaligned reads, so
> copying is required.

Just for my own knowledge, I knew the possible performance penalty, but
what does it mean that RISC does not allow unaligned reads ?
Say:

double d = *((double*)0x012345677) /* obviously non-aligned on 8 bytes
address */

What will it do ? Raise a processor fault ? return garbage ?



More information about the postgis-devel mailing list