Re: Review: B-Tree emulation for GIN - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: Review: B-Tree emulation for GIN
Date
Msg-id 4992D4D1.9090600@sigaev.ru
Whole thread Raw
In response to Re: Review: B-Tree emulation for GIN  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Review: B-Tree emulation for GIN  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
> Looking through the code again, gin_compare_prefix_##type looks a little
> confusing.
>
> Is there a reason for using:
>   (data->strategy == BTLessStrategyNumber ||
>    data->strategy == BTLessEqualStrategyNumber ) ?
>      PointerGetDatum(data->datum) : a
> rather than just using:
>   PointerGetDatum(data->datum)

Added comments:
     /*
      * Datum a is a value from extract_query method and for BTLess*
      * strategy it is a left-most value. So, use original datum from
      * QueryInfo to decide stop scanning on not. Datum b is always
      * from index.
      */


> Also, it might be a little less confusing if you used two separate
> variables rather than using "res" for two purposes.
done
--
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: A deprecation policy
Next
From: Ana Carolina Brito de Almeida
Date:
Subject: Copy PlannerInfo structure