Re: Microoptimization of Bitmapset usage in postgres_fdw

2018-06-30 Thread Michael Paquier
On Sun, Jun 17, 2018 at 07:23:19PM +0200, Daniel Gustafsson wrote: > On 17 Jun 2018, at 14:47, Michael Paquier wrote: >> - if (bms_num_members(clauses_attnums) < 2) >> + if (bms_membership(clauses_attnums) != BMS_MULTIPLE) >> For this one, the comment above directly mentions that at least two

Re: Microoptimization of Bitmapset usage in postgres_fdw

2018-06-17 Thread Daniel Gustafsson
> On 17 Jun 2018, at 14:47, Michael Paquier wrote: > > On Thu, Jun 14, 2018 at 08:14:54PM +, Bossart, Nathan wrote: >> I'll go ahead and mark this as Ready for Committer. > > Another thing not mentioned on this thread is that bms_membership is > faster than bms_num_members by design with man

Re: Microoptimization of Bitmapset usage in postgres_fdw

2018-06-17 Thread Michael Paquier
On Thu, Jun 14, 2018 at 08:14:54PM +, Bossart, Nathan wrote: > I'll go ahead and mark this as Ready for Committer. Another thing not mentioned on this thread is that bms_membership is faster than bms_num_members by design with many members, so this change makes sense to shave a couple of cycle

Re: Microoptimization of Bitmapset usage in postgres_fdw

2018-06-14 Thread Bossart, Nathan
Thanks for the updated patch set. On 6/14/18, 2:34 PM, "Daniel Gustafsson" wrote: >> 2) BuildRelationExtStatistics() in extended_stats.c. >> >> /* check allowed number of dimensions */ >> Assert(bms_num_members(stat->columns) >= 2 && >> bms_num_members(stat->columns) <=

Re: Microoptimization of Bitmapset usage in postgres_fdw

2018-06-14 Thread Daniel Gustafsson
> On 14 Jun 2018, at 16:56, Nathan Bossart wrote: > The v2 patches look good to me. However, I found a couple other > places where we might be able to use this micro-optimization. Thanks a lot for your review! > 1) dependencies_clauselist_selectivity() in dependencies.c > > /* >

Re: Microoptimization of Bitmapset usage in postgres_fdw

2018-06-14 Thread Nathan Bossart
The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: not tested Spec compliant: not tested Documentation:not tested Hello, The v2 patches look good to me. However, I found a couple other plac

Re: Microoptimization of Bitmapset usage in postgres_fdw

2018-05-30 Thread Daniel Gustafsson
> On 30 May 2018, at 09:36, Ashutosh Bapat > wrote: > > On Tue, May 29, 2018 at 9:10 PM, Daniel Gustafsson wrote: >> There are a couple of places in postgres_fdw where we check if the Bitmapset >> has multiple members using bms_num_members(), without storing the returned >> count. The attached

Re: Microoptimization of Bitmapset usage in postgres_fdw

2018-05-30 Thread Ashutosh Bapat
On Tue, May 29, 2018 at 9:10 PM, Daniel Gustafsson wrote: > There are a couple of places in postgres_fdw where we check if the Bitmapset > has multiple members using bms_num_members(), without storing the returned > count. The attached patch instead use bms_membership() which is optimized for > j

Microoptimization of Bitmapset usage in postgres_fdw

2018-05-29 Thread Daniel Gustafsson
There are a couple of places in postgres_fdw where we check if the Bitmapset has multiple members using bms_num_members(), without storing the returned count. The attached patch instead use bms_membership() which is optimized for just that usecase, and (IMO) makes for clearer code. cheers ./danie