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 1pcLhi-00044Y-LB for pgsql-performance@arkaria.postgresql.org; Wed, 15 Mar 2023 07:37:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pcLhh-0001Sb-66 for pgsql-performance@arkaria.postgresql.org; Wed, 15 Mar 2023 07:37:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcLhg-0001SS-T0 for pgsql-performance@lists.postgresql.org; Wed, 15 Mar 2023 07:37:44 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pcLhe-0002cf-EP for pgsql-performance@postgresql.org; Wed, 15 Mar 2023 07:37:43 +0000 Received: by mail-ed1-x52a.google.com with SMTP id h8so28037372ede.8 for ; Wed, 15 Mar 2023 00:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; t=1678865861; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=hrCJUP3ic9MQGq2zTpYB8S7/hdgjbO1ZjTqkOQeetps=; b=zTM0/e2AYjwSdKxAwMPtQdDjsrFwkvzMcgKzVAHe7MQGdhUo9ze0Q1KAPgrP8h7CLB Jr1FgqLnwhblxbgE2HedChee0Bu16vHYAtJ+emtHOqeNJ28DPGUvk83SVCYU4fqJhsnG h/u607We0Wmv/ZFNWA6aGBQaIlo07ehJcY6PYTUNUIyrxnEcSzVWgcdeq9lAJtqrEZl8 k89b4lokmIBF5yhoUu8kl7wiHa6SsSqgI7HfXLXwfjlj0aQgy3FiVPeoV2ZivCYFnspO lfJKaoi9gITVGVuwHELQdK1x8nX5PSMhXBsiz3OgwBkpp2ybF/OBNdoJ+V5ilkvaRKBF EN0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678865861; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=hrCJUP3ic9MQGq2zTpYB8S7/hdgjbO1ZjTqkOQeetps=; b=k52n1ABCF7GD4VUC2Z67H2OpeR6T9c0g4hMongco5OvspDenxGwCqb5Kq7CW0SpO9m Y0L6eXGJNz2yem1uwngRhJxk1itrOSdjc3wwJ7OdxCqJWIy0GMnpw3XkHZfhMhw2/ecI ZFEB3EYSn0oUvSyZGSbgQ5cIkUBrJPodMiXX9KMExPQGeVCZeSyw0G0dYBXvC4vdv3ZC Q6JIwpkiSzo8a2eEaBl8gpdyNjkzJMrRRFmk/Dwvm3YPWfdRm2gR82PC6LHsgaGzQlqL WirSWdKfQWFHicamb2wCE2JonAxIxmX0SZ/Z6VxYhOBUCvRtL4GtwtYikHqMOJtgrbRn kNWg== X-Gm-Message-State: AO0yUKX2R3czcpb/xn0EEQQwm3fqZDqWylVfytZcV8Mrxco9VhBpFv9C 0EdCcVto9xQBfuBy2hliZSCsn3h5fV1jz14Di+q72jK1 X-Google-Smtp-Source: AK7set8KmEwqUXmvy9tcvewSB/n+h4TeF/1lcPpocpnMDVNtbA92dXoouGaOTkYTTbrTxFnJqpSgBg== X-Received: by 2002:a17:906:3b8f:b0:8b2:3e72:1022 with SMTP id u15-20020a1709063b8f00b008b23e721022mr4511299ejf.29.1678865860872; Wed, 15 Mar 2023 00:37:40 -0700 (PDT) Received: from localhost.localdomain (p50992f7c.dip0.t-ipconnect.de. [80.153.47.124]) by smtp.gmail.com with ESMTPSA id si16-20020a170906ced000b008e1509dde19sm2092513ejb.205.2023.03.15.00.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 00:37:40 -0700 (PDT) Message-ID: <4ab9371f1eb13334fe5cece7e788d9c8d5be08f6.camel@cybertec.at> Subject: Re: multicolumn partitioning help From: Laurenz Albe To: James Robertson Cc: pgsql-performance@postgresql.org Date: Wed, 15 Mar 2023 08:37:39 +0100 In-Reply-To: References: <784863d0cce3f14dcb41252fe90c11de1e8da902.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2023-03-14 at 19:33 -0400, James Robertson wrote: > Laurenz your solution is how I thought I would work around my (lack of) u= nderstanding > of partitioning. (nested partitions). > I was hesitant=C2=A0because I didn't know what sort of performance proble= ms I would create for myself. >=20 > [...] more performance [...] If you are thinking of subpartitioning primarily in terms of boosting perfo= rmance, you should know that you only get performance benefits from partitioning wi= th very special queries that effectively have to be designed together with the partitioning strategy. Other statements typically become somewhat slower through partitioning. So it is really impossible to discuss performance benefits without knowing the exact query. It may be best if you build a play database with realisti= c amounts of test data and use EXPLAIN and EXPLAIN (ANALYZE) to see the effects that partitioning has on your queries. Yours, Laurenz Albe