Re: [HACKERS] taking stdbool.h into use - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [HACKERS] taking stdbool.h into use
Date
Msg-id 20171228004752.GA6181@paquier.xyz
Whole thread Raw
In response to Re: [HACKERS] taking stdbool.h into use  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: [HACKERS] taking stdbool.h into use  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On Wed, Dec 27, 2017 at 12:52:55PM -0500, Peter Eisentraut wrote:
> On 12/26/17 23:10, Michael Paquier wrote:
> > It would be nice to do something like that for GinTernaryValue in
> > tsginidx.c by mapping directly to GIN_FALSE and GIN_TRUE depending on
> > the input coming in gin_tsquery_consistent. The fix is more trivial
> > there.
>
> For GinTernaryValue, I think it's easier to just make it the same size
> as bool, since it doesn't go onto disk.  My earlier patch did that.  I'm
> not sure it's worth adding more code to copy the array around.

But on prairiedog the sizeof bool and char are different, so compilation
would fail, no? checkcondition_gin is used only by
gin_tsquery_consistent so I think that it is possible to get advantage
of that by using a secondary type of GinChkVal which uses directly a
bool array and converts the check value for the operand to a
GinTernaryValue value on-the-fly. I agree that this would make the code
more complex though for not much gain on modern platform.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: [HACKERS] [PATCH] Lockable views
Next
From: Jeff Janes
Date:
Subject: MCV lists for highly skewed distributions