Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xkbzw-0001Ci-Kc for pgsql-hackers@arkaria.postgresql.org; Sat, 01 Nov 2014 16:57:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xkbzv-0002s1-Eu for pgsql-hackers@arkaria.postgresql.org; Sat, 01 Nov 2014 16:57:55 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xkbzt-0002rs-47 for pgsql-hackers@postgresql.org; Sat, 01 Nov 2014 16:57:53 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xkbzl-0001Pl-Kj for pgsql-hackers@postgresql.org; Sat, 01 Nov 2014 16:57:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id sA1GvejL005726; Sat, 1 Nov 2014 12:57:40 -0400 From: Tom Lane To: Andres Freund cc: pgsql-hackers@postgresql.org Subject: Re: _mdfd_getseg can be expensive In-reply-to: <20141031225851.GO13584@awork2.anarazel.de> References: <20140331101001.GE13135@alap3.anarazel.de> <20141031223210.GN13584@awork2.anarazel.de> <12336.1414795725@sss.pgh.pa.us> <20141031225851.GO13584@awork2.anarazel.de> Comments: In-reply-to Andres Freund message dated "Fri, 31 Oct 2014 23:58:51 +0100" Date: Sat, 01 Nov 2014 12:57:40 -0400 Message-ID: <5725.1414861060@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) 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 Andres Freund writes: > On 2014-10-31 18:48:45 -0400, Tom Lane wrote: >> While the basic idea is sound, this particular implementation seems >> pretty bizarre. What's with the "md_seg_no" stuff, and why is that >> array typed size_t? > It stores the length of the array of _MdfdVec entries. Oh. "seg_no" seems like not a very good choice of name then. Perhaps "md_seg_count" or something like that would be more intelligible. And personally I'd have made it an int, because we are certainly not doing segment-number arithmetic in anything wider than int anywhere else. Introducing size_t into the mix won't do anything except create a risk of signed-vs-unsigned logic bugs. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers