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 1hvSWj-0002ON-VI for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Aug 2019 20:27:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hvSWi-0001Dc-MZ for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Aug 2019 20:27:16 +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 1hvSWi-0001D0-ED for pgsql-hackers@lists.postgresql.org; Wed, 07 Aug 2019 20:27:16 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hvSWf-000616-82 for pgsql-hackers@lists.postgresql.org; Wed, 07 Aug 2019 20:27:15 +0000 Received: by mail-qk1-x743.google.com with SMTP id u190so3261650qkh.5 for ; Wed, 07 Aug 2019 13:27:12 -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=XhZVLBm78xRWR4PAKKMDMjErUqhJZW5XHEqC4UQqCPY=; b=XX7Zo/f2nLUA/kS/VXMXsASKdYjEVvH3nC1Pree5izgLQKRvCvJFMnE9fvxmHZVPYp XhpcLAVnvN0lZIJEzOgkeyjQ+jClfecTqNPJDHAvgHnYKTYURhX7S10GeqcdODc6Klub rSsvpemvF2LnsQdB/ZNjTDFD9lLOFV3MzoPZGYL3wns6dLSRoSTajQE6okStII/OSC1h EtgcPFogmsM2PlvEbDuJab00tGAu4K5Umdw/bGocRvhrOwpUJvFNnhA3sOESsL/pwtxJ yolBMbQGdY9OgvUvFNSqX6eK1Pff0kcfaRy7jsVUEd+sxyTaA8UUPQSut9ilMJWla23A PRYw== 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=XhZVLBm78xRWR4PAKKMDMjErUqhJZW5XHEqC4UQqCPY=; b=atn/49KdSmQa+4xjgihLFE+r3Qhi9JidMKuIq4CDZyx0X9GGx6mViVj1zgzvXBs8Dv Bd23s/5oK7z+tRE3gb3DMcoHU4JJJZhb/TG1YYdQRV4CHPxXvoZ2hYJieMUXborxaCmm 9WUeYw0gan/Tb5AsYHjSdD332reD9fEHuTNf4fx3Ze9y72w00yVZMMCjmBe4lnm/abD5 W1RMqY58nAo8pydanyA4f7dF3u/Il0Cmyfkrh5wnduS1uHjD3yvv6B2s4stsvLTTME6Z PYMMN3jj089KLaVNT/0GqlWxPL5gKhz4gyARWToRIvAdgK4HqHxf5SRGHwnSKFVQjakn luFg== X-Gm-Message-State: APjAAAXwklLyWflNswL5tY/J5IBkwXGVXx4Acb/++iS90RLWwAp4QrdK 1qSWJGekB5d51TBip3fgfagot7TCz5A= X-Google-Smtp-Source: APXvYqzriStOxj7Iivf4m/gEBcMVaJvHysFrrS6qMQr1HkNqcpH/U0EfeRt3AhSiJ4Ga13/8YcEzsw== X-Received: by 2002:ae9:ef06:: with SMTP id d6mr9959437qkg.157.1565209629747; Wed, 07 Aug 2019 13:27:09 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([216.155.75.42]) by smtp.gmail.com with ESMTPSA id r5sm40090735qkc.42.2019.08.07.13.27.08 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 07 Aug 2019 13:27:09 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 0478E123B2C; Wed, 7 Aug 2019 16:27:07 -0400 (-04) Date: Wed, 7 Aug 2019 16:27:06 -0400 From: Alvaro Herrera To: Simon Riggs Cc: Amit Langote , yuzuko , shawn wang , Shawn Wang , PostgreSQL Hackers Subject: Re: Problem with default partition pruning Message-ID: <20190807202706.GA14015@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-Aug-07, Simon Riggs wrote: > I saw your recent commit and it scares me in various places, noted below. > > "Commit: Apply constraint exclusion more generally in partitioning" > > "This applies particularly to the default partition..." > > My understanding of the thread was the complaint was about removing the > default partition. I would prefer to see code executed just for that case, > so that people who do not define a default partition are unaffected. Well, as the commit message noted, it applies to other cases also, not just the default partition. The default partition just happens to be the most visible case. > "So in certain cases > we're scanning partitions that we don't need to." > > Avoiding that has been the subject of months of work. Well, yes, avoiding that is the point of this commit also: we were scanning some partitions for some queries, after this patch we're supposed not to. > "This has the unwanted side-effect of testing some (most? all?) > constraints more than once if constraint_exclusion=on. That seems > unavoidable as far as I can tell without some additional work, but > that's not the recommended setting for that parameter anyway. > However, because this imposes additional processing cost for all > queries using partitioned tables..." > > One of the major features of PG12 is the additional performance and > scalability of partitoning, but we don't seem to have benchmarked the > effect of this patch on those issues. > > Please could we do perf checks, with tests up to 1000s of partitions? And > if there is a regression, I would vote to revoke this patch or address the > request in a less general way. I'll have a look. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services