Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYFFN-0002kn-Ij for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jan 2017 16:56:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cYFFL-0006hH-Q5 for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jan 2017 16:56:03 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cYFFJ-0006gK-VP for pgsql-hackers@postgresql.org; Mon, 30 Jan 2017 16:56:02 +0000 Received: from mail-qt0-x232.google.com ([2607:f8b0:400d:c0d::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cYFFG-0005Ag-VX for pgsql-hackers@postgresql.org; Mon, 30 Jan 2017 16:56:00 +0000 Received: by mail-qt0-x232.google.com with SMTP id x49so208222525qtc.2 for ; Mon, 30 Jan 2017 08:55:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=1P3FgGwUwmo71qROGF+91Lr4KHNTMEYqyfry4Rn9XhI=; b=Jss3WdxF2FN274i1Auyb+LGCWp2Py4jK+OASAbJEDegi7CcogHQgBp32Wl1iYnZnF+ z8En3hBMRomoSr5pAV8chOcuOE+8KU727AFrvy9Wm4f/Br/HMQWqhzssklsn1SznXDlk 7w/OcVCNGFZ8/FMWDM6a/ipWb4XKGIW/oaxsSYiRsdZlsC4evsY34ZeZCPK+qmyc3VJJ Xcapd+auVOAwxcx4BmzxG7Hr1XfBG85NherG89LbRu2CnXw1OwhPeUVUBNsaJZSR0yJR MSbvJNY1yVqZ1rhOc8MXq0izC7LWVsydUUsOOCdo6WQwGCXCjZX8pJ7aaGisuPqGr3Nm TlFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=1P3FgGwUwmo71qROGF+91Lr4KHNTMEYqyfry4Rn9XhI=; b=Y1xsFjn0HC+Q+rdUCbyJ2x6Esnub7pm86UrpzUBpYu/1wt6CDMSDcwDS4evpSxNg5q Mt1LvVpgzj06fv1TB5y3FG2toZo22SStX7g92E497h+G5lQnHUwDDSeYCSHboIKZG4Mw gQNa3PY/r5BKt5mzlf+VBH/hcyIWAMNV+Z6RIiF3/fQfqyrQvMeXRGYoOU6tX7GeyVgZ GETfaWNlWLc7cuH37wPqmaXpML/Ab0qh1pm7kFSpSZMSGKgTPeT1Dgx6etd1CeFqgLc9 p8H6IBJr1lpHmBG3Y/Vn3B+jaaWA5DYEisc1FPcWq+1CPch/4tdNBiOGE3Xp6/Wjlf+f o05Q== X-Gm-Message-State: AIkVDXKUboo+ZtZnm7bWU+HGv0wdsSPmbOg4WTaM7MxjRHFFnFQhvNYMkHLlukIb4PYbF7ZJ X-Received: by 10.200.0.213 with SMTP id d21mr20616697qtg.44.1485795357825; Mon, 30 Jan 2017 08:55:57 -0800 (PST) Received: from alvin.alvh.no-ip.org ([190.217.211.239]) by smtp.gmail.com with ESMTPSA id o7sm12621535qte.30.2017.01.30.08.55.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 08:55:57 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 735F7EF9; Mon, 30 Jan 2017 13:55:55 -0300 (CLST) Date: Mon, 30 Jan 2017 13:55:55 -0300 From: Alvaro Herrera To: Tomas Vondra Cc: Dilip Kumar , Amit Langote , Dean Rasheed , Heikki Linnakangas , Michael Paquier , Robert Haas , Tatsuo Ishii , David Steele , Tom Lane , Petr Jelinek , Jeff Janes , "pgsql-hackers@postgresql.org" Subject: Re: multivariate statistics (v19) Message-ID: <20170130165555.5h2hyncs5l2ldrhx@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <696aa95c-2411-9b2b-f36e-65b66bf47c88@2ndquadrant.com> User-Agent: NeoMutt/20170113 (1.7.2) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers