Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XkcP7-00022I-Jt for pgsql-hackers@arkaria.postgresql.org; Sat, 01 Nov 2014 17:23:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XkcP7-00015G-4K for pgsql-hackers@arkaria.postgresql.org; Sat, 01 Nov 2014 17:23:57 +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 1XkcP5-000159-WF for pgsql-hackers@postgresql.org; Sat, 01 Nov 2014 17:23:56 +0000 Received: from mout.kundenserver.de ([212.227.17.13]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XkcP2-0001sS-EK for pgsql-hackers@postgresql.org; Sat, 01 Nov 2014 17:23:54 +0000 Received: from anarazel.de (p54AF4ED2.dip0.t-ipconnect.de [84.175.78.210]) by mrelayeu.kundenserver.de (node=mreue103) with ESMTP (Nemesis) id 0MZOEH-1XTutl0cqT-00LGWq; Sat, 01 Nov 2014 18:23:48 +0100 Received: by anarazel.de (Postfix, from userid 1000) id 482B7100B43; Sat, 1 Nov 2014 18:23:47 +0100 (CET) Date: Sat, 1 Nov 2014 18:23:47 +0100 From: Andres Freund To: Tom Lane Cc: pgsql-hackers@postgresql.org Subject: Re: _mdfd_getseg can be expensive Message-ID: <20141101172347.GP13584@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> <5725.1414861060@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5725.1414861060@sss.pgh.pa.us> X-Provags-ID: V02:K0:wvPBg7Pzv6Or5hXu5i3W0cHlfY5UBE2UweAC0kULbmG fzvdpW1SNkF2Up7cOIHgDqPlsPK9KIo4plOed8lPYbi9L9uPZU mIngr6iKcWdFB5xDMnHGYAzYcgcgoB/nlQm7SoKDLOetC7DdzL Iv3t9opXfULciUlyuVmaMmhixDmDkG7F8kDjpWoub3egQko6tO +6BvnxHdQ9YJf2l5o6WD4bkkLNOSxp9HyG5/C5Datl8Yb54D2s DOKCEvw05oH+uwGwb7ZQw56ChfOT2+bbfX5GI8ZYGfi+FB8DvE Jtzohl8LpG82rKol81hh3ClASY0+nahUWTkxGKv5u1iwk3uj1i WtLGE65vfdFZ14HU9JIl3AH7u2sib3XxbpOxHbi+i X-UI-Out-Filterresults: notjunk:1; X-Pg-Spam-Score: -1.9 (-) 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 On 2014-11-01 12:57:40 -0400, Tom Lane wrote: > 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. That's fine with me. > 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. Fine with me too. I picked size_t by habit, because there's projects that don't allow anything else to be used for lengths of memory... I've, during testing, also noticed it has accidentally introduced a vfd/memory leak... So I'll repost a version with those fixes. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, 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