Re: [HACKERS] multivariate statistics (v19) - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: [HACKERS] multivariate statistics (v19)
Date
Msg-id a2c4bbc5-09b3-9552-f59e-6aa93419c71a@2ndquadrant.com
Whole thread Raw
In response to Re: [HACKERS] multivariate statistics (v19)  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On 01/30/2017 05:55 PM, Alvaro Herrera wrote:
> Minor nitpicks:
>
> Let me suggest to use get_attnum() in CreateStatistics instead of
> SearchSysCacheAttName for each column.  Also, we use type AttrNumber for
> attribute numbers rather than int16.  Finally in the same function you
> have an erroneous ERRCODE_UNDEFINED_COLUMN which should be
> ERRCODE_DUPLICATE_COLUMN in the loop that searches for duplicates.
>
> May I suggest that compare_int16 be named attnum_cmp (just to be
> consistent with other qsort comparators) and look like
>     return *((const AttrNumber *) a) - *((const AttrNumber *) b);
> instead of memcmp?
>

Yes, I think this is pretty much what Kyotaro-san pointed out in his 
review. I'll go through the patch and make sure the correct data types 
are used.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] patch: function xmltable
Next
From: David Steele
Date:
Subject: Re: [HACKERS] patch proposal