Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gAe0J-0006zW-Lj for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Oct 2018 16:40:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gAe0H-0001RD-1u for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Oct 2018 16:40:01 +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.89) (envelope-from ) id 1gAe0G-0001R3-DW for pgsql-hackers@lists.postgresql.org; Thu, 11 Oct 2018 16:40:00 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gAe0C-0000Gp-Qv for pgsql-hackers@lists.postgresql.org; Thu, 11 Oct 2018 16:39:59 +0000 Received: by mail-qt1-x844.google.com with SMTP id u34-v6so10585853qth.3 for ; Thu, 11 Oct 2018 09:39:56 -0700 (PDT) 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=heIOStqPk4Ox087H5GUEXZrVyGBlWg/ycH2fIvwHB4E=; b=ZmOMEN6mqovE3f0AVUBlLlAURf7NK+DFAo76fxN7lIIsJ8aEBdHbzDfsZtu/pADvs2 DncHvT3KK1x0NpnC5AjGcUhKzTVy9g0Uc81KMkKoam8jg+S/knEp7Yc7ZrM9H8/jv3Gc KkoRoIgvt7W5LVcbwl9H8ovAonH1Pz9Y9QAEwZ7vZLCHlpaBRNmyybJ81mHaqYrApf0e xgqpyaYZftJNhsK8I12v9FmMG6gU+3jmS4moYIFsHjxLywPSotgdLTOqpPP4Dyonegpd qYQFQdBLoMoz4P2kdZbaKK317w2OYNw7NcavidZASAxpTcRjfWyxHPrU7hLukHLQ1/EJ LsEg== 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=heIOStqPk4Ox087H5GUEXZrVyGBlWg/ycH2fIvwHB4E=; b=H/YoziDK4UB4RRsvVQOQM6RpVrhQLSJYKuYVmg4ywkpFKThcmLk373M2RpxYWGsdkQ XC8H0fujgagZKFz4Y9cf38TJYkbI1TFsQgLovo5zICDX+xrtpPW8K0WbLgY3slI1c4LN Tk7xwVgtmhJigg0+T0fKtSq0cuqnVbr0MKxt/5Dh2ypb+bJRbQI67CHn5bSLyM1U4QIM 7grDLZ21cA1nv/LK4FqwR2B/zrBy7kvfY20f6xz3Nqg75al8splk+9pShZEHwp/pemal xPD3ediqnFPuYf1JVRd93tIoooGZ82XFFJgT4TAYWW1YFtZyNCat5CAku9QiC7NLYeXD WruA== X-Gm-Message-State: ABuFfojgZ68qQx+JyegGPZIK2W04pPMKVBzhG+ANWtLYnRtC0X1/QwfB elr7iqe/bHjGspxOdMJN1+Fy0w== X-Google-Smtp-Source: ACcGV63B7keGJJ2ZOCWw+o6zxaeItyIMTbYp6hRZZedPva2Kv0/8hqykyHwBDEf7FbjhsJzLPcA2tA== X-Received: by 2002:ac8:23ed:: with SMTP id r42-v6mr2187691qtr.89.1539275995026; Thu, 11 Oct 2018 09:39:55 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id o185-v6sm13320335qke.34.2018.10.11.09.39.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Oct 2018 09:39:54 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id DDC4472C; Thu, 11 Oct 2018 13:39:52 -0300 (-03) Date: Thu, 11 Oct 2018 13:39:52 -0300 From: Alvaro Herrera To: Tom Lane Cc: Robert Haas , Jeevan Chalke , pgsql-hackers@lists.postgresql.org, David Rowley Subject: Re: Soon-to-be-broken regression test case Message-ID: <20181011163952.emtpcrzkpselhupj@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5395.1539275668@sss.pgh.pa.us> User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-Oct-11, Tom Lane wrote: > I have been fooling around with a patch to allow pull-up of sub-selects > that lack any FROM, along the lines discussed in > https://www.postgresql.org/message-id/15944.1521127664@sss.pgh.pa.us > I find that it is smart enough to reduce that EXISTS to a plain > expression, yielding > > QUERY PLAN > ---------------------------------------------------- > Subquery Scan on tenk1_vw_sec > -> Index Only Scan using tenk1_unique1 on tenk1 > Index Cond: (unique1 = 0) > (3 rows) Hmm, I have the feeling that this would nullify some tests in partition_prune also, which IIRC pretend to invoke runtime pruning with things like "WHERE partcol = (select 1)". -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services