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 1ievPn-0003fx-0i for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Dec 2019 06:24:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ievPj-00040Y-Vk for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Dec 2019 06:23:59 +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 1ievPj-00040R-Hd for pgsql-hackers@lists.postgresql.org; Wed, 11 Dec 2019 06:23:59 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ievPf-0007RH-UT for pgsql-hackers@postgresql.org; Wed, 11 Dec 2019 06:23:58 +0000 Received: by mail-wm1-x332.google.com with SMTP id p9so5721241wmg.0 for ; Tue, 10 Dec 2019 22:23:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=MGoCEiUmLyTY6doLid/sKEBLspFPge2Ba+MTW4r58fc=; b=EvPvdqpNtD1TKDOJIyu+Heiqz6cSgcz9RVg/61/zIbKUXWRZd2oOedQXslrlsf0v+e 8gv3oU14Pw1yQtfqn1+pQ8bankydnnf6VhKYdsvlMG3dIjJ+twKQ78wytlMnBn0pLCf2 2pQhnYHWYzM62qTPCHbAzBBLPFuilSHRa7zowFyOCFjPhwymmcZD7ZY+dSYThQi4KTsS NhgDyPiwukQ9Sgp3K8ts3U/sgL1UGNd/03d3DAOT6bgVVI8M7l5ab1IPyzdsvlcCEfIB Zo+VMpRzAVfF9OZdxbh6ONsBciwWa0V7fvB0vO7Bywjlh2VwO2YfrA/k7fIxz16d5PPy d54g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=MGoCEiUmLyTY6doLid/sKEBLspFPge2Ba+MTW4r58fc=; b=W/huYWnY7J3kBYiG6N6cVW3+Fd0lUDZDZ0JTpAc1RQz9uvduGlAqGAw4meqS8T36i5 noQQmNFlBvUdVg9u2eH+ZFYeVeLAs3XzmIyCjLbRAC/gx4USWrIou36DO+IhDCIuScRb c8CXYZQgMZJD5FgmMIeU2MP5Sw16jcdIq+J+VW7TzjIc9hnI8GSsY4UsqLL3Gg2s+k/n xaJ1cSPK6K6xJ4A/vckocfev6JL+xmDY8CVCCXv9yhi+a8T2sDULtJUzkk+VE7o0hHVE FbiJIdmpTsjmDnLFlmdgUSIxHLQSCtAMimQ6xcLNFP2bwKQKurWdvl4ClUS5yCMrwAZi +rtA== X-Gm-Message-State: APjAAAUt4p4QYi8D3knXKgEtdxh4LiQNvpGSzyIuIZG59+1Y9t8yUkLX FE7I/3YSthkWTW4n8Zhtxwtu0Q== X-Google-Smtp-Source: APXvYqySs5e4y/J9MlX9unK+krjWMvvumyswe/xZpQs1TF3YiI2Gfq5guiTUM3rd0GuKXaXdGJTEtQ== X-Received: by 2002:a1c:7ecf:: with SMTP id z198mr1427299wmc.87.1576045433492; Tue, 10 Dec 2019 22:23:53 -0800 (PST) Received: from linux.fritz.box (2a0a-a540-4f5e-0-85f2-a004-eb97-824f.ipv6dyn.netcologne.de. [2a0a:a540:4f5e:0:85f2:a004:eb97:824f]) by smtp.gmail.com with ESMTPSA id g21sm1125329wrb.48.2019.12.10.22.23.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 22:23:52 -0800 (PST) Message-ID: <6da76620383a421c2f4164bd314bab9499d2ec5c.camel@cybertec.at> Subject: Re: On disable_cost From: Laurenz Albe To: Jim Finnerty , pgsql-hackers@postgresql.org Date: Wed, 11 Dec 2019 07:23:51 +0100 In-Reply-To: <1576018229539-0.post@n3.nabble.com> References: <20191101160038.wn3qkvp4psnatmm3@alap3.anarazel.de> <1572625852934-0.post@n3.nabble.com> <20191101170406.w6ybnafyvpxv2ltg@development> <30025.1572707098@sss.pgh.pa.us> <1576018229539-0.post@n3.nabble.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, 2019-12-10 at 15:50 -0700, Jim Finnerty wrote: > As a proof of concept, I hacked around a bit today to re-purpose one of the > bits of the Cost structure to mean "is_disabled" so that we can distinguish > 'disabled' from 'non-disabled' paths without making the Cost structure any > bigger. In fact, it's still a valid double. The obvious choice would have > been to re-purpose the sign bit, but I've had occasion to exploit negative > costs before so for this POC I used the high-order bit of the fractional > bits of the double. (see Wikipedia for double precision floating point for > the layout). > > The idea is to set a special bit when disable_cost is added to a cost. > Dedicating multiple bits instead of just 1 would be easily done, but as it > is we can accumulate many disable_costs without overflowing, so just > comparing the cost suffices. Doesn't that rely on a specific implementation of double precision (IEEE)? I thought that we don't want to limit ourselves to platforms with IEEE floats. Yours, Laurenz Albe