Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mSIdL-00066Q-Im for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Sep 2021 12:42:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mSIdK-0004pj-HG for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Sep 2021 12:42:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mSI7r-0001DO-Gb for pgsql-bugs@lists.postgresql.org; Mon, 20 Sep 2021 12:10:23 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mSI7o-0007nP-EB for pgsql-bugs@lists.postgresql.org; Mon, 20 Sep 2021 12:10:22 +0000 Received: by mail-wr1-x42d.google.com with SMTP id w29so28988448wra.8 for ; Mon, 20 Sep 2021 05:10:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=deepbluecap-com.20210112.gappssmtp.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=UUNNpgK8I60uvieOGYjp9v61Vnlv6bU10TETXgW+Tys=; b=hEd191kKoY2/NyL9fcLpyZ9xRv8rEZDxlm1VKaMR8lW0kTyje4LsQtZJSN9sYu+0z4 PKOFz5a8ALuzUGRXGmrkdCuDGD8rk2bh4H4rmV+f+n4m2S18sp9TWiBpBVtLG8uKI+Bq anjagAT7ucIBjS6wx91PytIV6k0Puk6zV9IKhyx7ZuMeLp88mZOqguDs2m+7uut5x7RX rXu/4w27e/dCv5hAy3/pZPV/iqFJskD/hh9UboMTG6O6cZvLvaPwyUxzSNcBMItNwD1G lxCZAoB5oolrOWKkExkXOK3tS9xczsd6ua3gmGKryZbJdi4f8LjrVBgbK8gg38j1tMcB xrEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UUNNpgK8I60uvieOGYjp9v61Vnlv6bU10TETXgW+Tys=; b=gTduhZgunXZnUxtp+PWFsBRUiLYqHqizUMcc/zCpwffCkKiZx35pciTob9VNcG3OJ1 I9yJsyb7CXR0iWTflWGO5Zx/lVW3pHWvyTA5OpB84DY6nxRMypiR/bz+f2yNSlWCGx+D TQKrdfq+SBsm5KRwBAsO9UG4S/+jkzWfyol79mPrXwublgYA1hHhyntiBM3TcwgF4BZt lwrVyYDgYkqGkjqOcGv8g6Jl7DMnsVR/T5aAGcwE12xBqn6vGC2XcNUd5rKDvxrlvzK0 XEqrw9hAgsGC/5XwcsBlQZkzy9cxw+InqpkTsLtbHuQZjYM//qd8qkz76IsZ7k36T6b8 G5AA== X-Gm-Message-State: AOAM532bhmdfLKELzhBsxrV2wlsyNulzhjhZBe4DVC3jXNsiizgCor8z XWRX3lnjLcmq3g0OJp0xaRP5b4uXcuySesgxj+0JRgXnrwZjsPhFmBe8zry0QTanPkyQ5bpbAkW lmT89yHdZVebiUDlStsZDcnkE8siBUM3gc6uvtkMCejD1uFDSD0eqLCPu59pFdyg7r+dfj8Cu7u bsvi0Fzmfuwc3WUFrP2usS X-Google-Smtp-Source: ABdhPJxN/CRdrR3F7kY3ejmpu9tmuBr77emzSw21UXS812HBUQf/0JRKpD4gncCkcoZY4Nr+o8Suzw== X-Received: by 2002:a5d:530a:: with SMTP id e10mr28952199wrv.277.1632139818825; Mon, 20 Sep 2021 05:10:18 -0700 (PDT) Received: from ?IPv6:2a01:e0a:255:1000:2151:2abe:75f:2959? ([2a01:e0a:255:1000:2151:2abe:75f:2959]) by smtp.gmail.com with ESMTPSA id t23sm16523786wrb.71.2021.09.20.05.10.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Sep 2021 05:10:17 -0700 (PDT) Subject: Re: Query planning on partitioned table causes postgres 13.4 to consume all memory To: Tom Lane Cc: pgsql-bugs@lists.postgresql.org References: <4a3115d4-0fb2-e214-93e3-9a9d0974b883@deepbluecap.com> <1556207.1632067384@sss.pgh.pa.us> From: Duncan Sands Message-ID: <98598292-22bb-1304-656f-773f3677a0a8@deepbluecap.com> Date: Mon, 20 Sep 2021 14:10:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <1556207.1632067384@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Tom, On 19/09/2021 18:03, Tom Lane wrote: > Duncan Sands writes: >> [ planning DELETE on a thousand-partition table takes forever ] > > FWIW, this situation has been very much improved for v14 [1]. thanks, part (2) of that commit indeed looks like it should solve it. Best wishes, Duncan. > In older branches, the best advice I can give you is "don't use > so many partitions". Especially not with hash partitioning, > where the query WHERE clause generally won't translate to any > useful pruning of the partitions. > > (Personally, I think that hash partitioning is an evil that > we shouldn't have implemented at all. Or at least there > should be stronger warnings about it in the manual than there > are now.) > > regards, tom lane > > [1] https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=86dc90056 >