Re: wrong query result with jit_above_cost= 0 - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: wrong query result with jit_above_cost= 0
Date
Msg-id 878t71p9c8.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: wrong query result with jit_above_cost= 0  (Dmitry Dolgov <9erthalion6@gmail.com>)
Responses Re: wrong query result with jit_above_cost= 0
List pgsql-hackers
>>>>> "Dmitry" == Dmitry Dolgov <9erthalion6@gmail.com> writes:

 Dmitry> Yep, my bad, forgot to turn it on. Now I see what's the
 Dmitry> problem, one of the null fields is screwed up, will try to
 Dmitry> figure out why is that.

The handling of nulls in grouping set results is a bit icky, see
prepare_projection_slot in nodeAgg.c. The comment there lists a number
of assumptions which may or may not hold true under JIT which might give
a starting point to look for problems. (Unfortunately I'm not currently
in a position to test on a JIT build)

(This wasn't my first choice of approach; originally I had a GroupedVar
node that evaluated either as the Var would or to NULL instead, and put
that into the projection. However there was a lot of resistance to this
approach at the time, and the new node idea was abandoned in favour of
poking directly into the slot.)

-- 
Andrew (irc:RhodiumToad)


pgsql-hackers by date:

Previous
From: Robbie Harwood
Date:
Subject: Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints
Next
From: Andres Freund
Date:
Subject: Re: wrong query result with jit_above_cost= 0