Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1grO4E-0001gB-6E for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Feb 2019 14:20:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1grO4C-0007aA-V2 for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Feb 2019 14:20:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1grO0J-0007vM-6m for pgsql-hackers@lists.postgresql.org; Wed, 06 Feb 2019 14:16:43 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1grO0G-0000pK-Ig for pgsql-hackers@postgresql.org; Wed, 06 Feb 2019 14:16:42 +0000 Received: by mail-qt1-x843.google.com with SMTP id y4so2440636qtc.10 for ; Wed, 06 Feb 2019 06:16:40 -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=6cHua9ywWHLtu3wN8OAYfpimYHgh5z2fchGasmH3Txs=; b=d06B5OtdKtP8rTvOYHaVp7TGiR1abPFC6NcseWz5VDWRjHT/ID3YExuln8kG1xaujW QsCmWKu7A+fzsmBYKQsctxCwCVxklmltov9mSbGEIIt4cJutz5rs20XOQMwSGyZTJ8L7 MVd9o0oqOCA77HKLquzH7mthJzo4mZ9uLiv9osFrxm5+Xu65VkHO1iau19aRJ5autItH JexarF2p24hmE1eCyz6KhMdA7uu1At/b3R2vjog56JcrIZIboErAOuFejqeaqV76d00M SXPiiNDXf8u+caLBHcPUymH6Mif+70W/5HWezEjS21TbfRPR0JmWh06qNl1XJcOEoLFR OF6w== 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=6cHua9ywWHLtu3wN8OAYfpimYHgh5z2fchGasmH3Txs=; b=AE2ygtwd85xAQ+qg4+NGJPSl+FetQemltjp3UGWbcrIwbgMlyIkXB2w8WHFTO0C8db 9k5mYFTUGk4M3K69S5EIolCK886piTnuvdikJmyEWqdF4rpe6ZGz+QtdoGyQ7ZOumb4J hdVpDcZnnzYYypYeJCXbmcLJbEOcWwKxVZ3tHCbFJrci9ZjmzdemLWfMloyjAQizrYSc 84zcQnChtltiquRS+Xsvuc6IfUM7T9c79QdA0oXGT5t8VMIBzZaMfVhi+q2rxLBoxt5W N74RnCczxrdB8v1bGCHE9x7Qem7ShhMe/Amg6wYbGr/HzP0vona+27RvxzhiS2SayCdf mOMg== X-Gm-Message-State: AHQUAuZkoioUc2HsqbEFEBNvtYAD3f3VNfoQcOeZOL2U0+0xcKwODscx lhjZYVsiTVFRcnz+yygOVQD7FGljHrqo1g== X-Google-Smtp-Source: AHgI3Ib1ZUIwIApVUCP8JkhvJtOFYezpbHQj3uv7gu5PxXFpmAhqf3WbjZr2LvCUm7vH1zZgaNzRWg== X-Received: by 2002:a0c:d933:: with SMTP id p48mr8166719qvj.15.1549462599084; Wed, 06 Feb 2019 06:16:39 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([191.125.99.212]) by smtp.gmail.com with ESMTPSA id k22sm15131521qtm.73.2019.02.06.06.16.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Feb 2019 06:16:35 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id BC51F12422F; Tue, 5 Feb 2019 22:44:38 -0300 (-03) Date: Tue, 5 Feb 2019 22:44:38 -0300 From: Alvaro Herrera To: Andres Freund Cc: Andrew Dunstan , pgsql-hackers@postgresql.org Subject: Re: fast defaults in heap_getattr vs heap_deform_tuple Message-ID: <20190206014438.GA3755@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190205165705.7cqrwvjxvip7dcow@alap3.anarazel.de> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Feb-05, Andres Freund wrote: > @@ -82,7 +80,7 @@ static Datum getmissingattr(TupleDesc tupleDesc, int attnum, bool *isnull); > /* > * Return the missing value of an attribute, or NULL if there isn't one. > */ > -static Datum > +Datum > getmissingattr(TupleDesc tupleDesc, > int attnum, bool *isnull) This is a terrible name for an exported function -- let's change it before it gets exported. Heck, even heap_getmissingattr() would be better. I notice that with this patch, heap_getattr() obtains a new Assert() that the attr being fetched is no further than tupledesc->natts. It previously just returned null for that case. Maybe we should change it so that it returns null if an attr beyond end-of-array is fetched? (I think in non-assert builds, it would dereference past the AttrMissing array.) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services