Re: Index Skip Scan

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: Index Skip Scan
Дата
Msg-id 20190924.174146.159197618.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на Re: Index Skip Scan  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Ответы Re: Index Skip Scan  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
At Tue, 24 Sep 2019 17:35:47 +0900 (Tokyo Standard Time), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in
<20190924.173547.226622711.horikyota.ntt@gmail.com>
> At Sun, 22 Sep 2019 23:02:04 -0300, Alvaro Herrera <alvherre@2ndquadrant.com> wrote in
<20190923020204.GA2781@alvherre.pgsql>
> > On 2019-Sep-22, Dmitry Dolgov wrote:
> > 
> > > > I think multiplying two ScanDirections to watch for a negative result is
> > > > pretty ugly:
> > > 
> > > Probably, but the only alternative I see to check if directions are opposite is
> > > to check that directions come in pairs (back, forth), (forth, back). Is there
> > > an easier way?
> > 
> > Maybe use the ^ operator?
> 
> It's not a logical operator but a bitwise arithmetic operator,
> which cannot be used if the operands is guaranteed to be 0 or 1
> (in integer).  In a-kind-of-standard, but hacky way, "(!a != !b)"
> works as desired since ! is a logical operator.
> 
> Wouldn't we use (a && !b) || (!a && b)? Compiler will optimize it
> some good way.

Sorry, it's not a boolean. A tristate value. From the definition
(Back, NoMove, Forward) = (-1, 0, 1), (dir1 == -dir2) if
NoMovement did not exist. If it is not guranteed,

(dir1 != 0 && dir1 == -dir2) ?


regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: [PATCH] Speedup truncates of relation forks
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: abort-time portal cleanup