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 1h6EvZ-0008Mo-Qp for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Mar 2019 13:37:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h6EvY-0001Mo-Hp for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Mar 2019 13:37:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6EvY-0001IV-06 for pgsql-hackers@lists.postgresql.org; Tue, 19 Mar 2019 13:37:12 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6EvQ-0005Y7-ES for pgsql-hackers@postgresql.org; Tue, 19 Mar 2019 13:37:10 +0000 Received: by mail-qk1-x743.google.com with SMTP id c20so7054747qkc.10 for ; Tue, 19 Mar 2019 06:37:04 -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=F2d2vLG5Bjc5oQoasKqOuC2xHm4pVyN5VKHnKsjpIO4=; b=bnz0OxLJ2LanyHosRIPpuR2OOahJspTfBIhkG+5AVV+17OltOtyM6tawsC1nu80yrf HgU6jdg8AsPEgFldrxsD+NC8IZBCnfNZ7BzI4O2xyDVukACSsvIPwWpAaEba0gm3Z20P 4GujO9I2tYHsbhlSFBWtIpqsNnBtNqJBysC+W2CICe5AIJFG2k6eRsOyBBOjLf+7/sud yvhtPV4YfHG6nVPneLtmv8SHZPn80S27s5JmkDvVLbsYosdX457H41t1P+V96eJdbKRb iw0rI8psS9rE5X/Z92n/1lpG28K44tkj1+urHqYBcMONRkdpDPKU5Yzp3z6RkI0UQb6B 5+bQ== 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=F2d2vLG5Bjc5oQoasKqOuC2xHm4pVyN5VKHnKsjpIO4=; b=BhTn0h5Btq7MwRL3zWu7rxSFC4qAR0pnvPZTJjvuUIiAgpa1XlRdAagBGb/tBVSqQ3 jP2loX/9pBqoGJpZWdstHfJv6zS21tCFVr/jmKyqDgN32EK2Id3XYkDU6xEcEkQYkI32 tRriawHPjafXV/QCyfVr0vrZjjBvi4DyHFXh3DsT02UhPLjqlydATfb9UFRszfRfKEyN EuJp8mJi1raJxGBmuXXYDHGpcdJLqHBKO/i3AZCMzvqW/YZA+hJ1XV+mkYG9VsADy2P1 vZRtYgqj+/75EupepsfNUBia+vfqq4edUa6SUETcWIt51fBuVm8tlmXXiLL5kF2OaWw1 QtjA== X-Gm-Message-State: APjAAAUF6VGXEpGIO2HLvEnqkY8bj367EwGJAmBI9dnLyGymhpxT6oiw hBVpYmYuVJCU+zIqQkPP8i+wWQ== X-Google-Smtp-Source: APXvYqyc3E8osmzQ+7QXpJVm7yVMpdCbuQuCLEd+3d+6Wzfc5K0oZnGsEyFIU1H0e3UXNV9F+E46HQ== X-Received: by 2002:a37:68cc:: with SMTP id d195mr1832656qkc.131.1553002623459; Tue, 19 Mar 2019 06:37:03 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id w62sm4193729qkd.56.2019.03.19.06.37.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 06:37:02 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 5B521121E00; Tue, 19 Mar 2019 10:37:00 -0300 (-03) Date: Tue, 19 Mar 2019 10:37:00 -0300 From: Alvaro Herrera To: Robert Haas Cc: Amit Langote , Pg Hackers Subject: Re: partitioned tables referenced by FKs Message-ID: <20190319133700.GA9899@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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-Mar-14, Robert Haas wrote: > On Thu, Mar 14, 2019 at 3:36 PM Alvaro Herrera wrote: > > In any case, since the RI > > queries are run via SPI, any unnecessary partitions should get pruned by > > partition pruning based on each partition's constraint. So I'm not so > > certain that this is a problem worth spending much time/effort/risk of > > bugs on. > > I doubt that partition pruning would just automatically DTRT in a case > like this, but if I'm wrong, great! Uh, it was you that came up with the partition pruning system, so of course it DsTRT. I did test (some of?) the queries issued by ri_triggers with partitioned tables on the PK side, and indeed it seemed to me that partitions were being pruned at the right times. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services