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 1q17GI-0006AW-9J for pgsql-admin@arkaria.postgresql.org; Mon, 22 May 2023 15:15:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q17GH-0000V5-3H for pgsql-admin@arkaria.postgresql.org; Mon, 22 May 2023 15:15:49 +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 1q17GG-0000Uv-MX for pgsql-admin@lists.postgresql.org; Mon, 22 May 2023 15:15:48 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q17GD-001EGA-TQ for pgsql-admin@lists.postgresql.org; Mon, 22 May 2023 15:15:47 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id ADCD569FD7; Mon, 22 May 2023 15:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1684768543; bh=PbiAmAmkDjkuayGCdpMd9wiM/Wo5kEHfwRsi65OLGck=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=HDmrwEygehYwJph6k7a2O+ztym7KvaeI+/C4Qqwu+iG6tKTfmpGKkGNpZfd+D1OXn bO1dPQ2HV16Ac1I9+mtq+bXES5OepV/Cd9aULwaUTGo9mn13FRMXnd8PbC0Zf0IQcC vhPM/4Mc37VKMDWKiDzMLbcoWAfAMdIrCvJZY9DmKLuLfwQoGVhD7q7MXu6uMG1I86 hlvzs20qHXTjovto1G/IWNZB9lcUl/XnivtAVd5ZwKiyCoHyHzneKw4/nvGgljeStq l4Mhk6HSgiVJWEQ07CiULA1FYI1XFldE6oyFk0TTu13PfXoce/14FicGpPrsFrcW4C VlR6lXFkzIhXw== X-Virus-Scanned: Debian amavisd-new at emo09-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo09-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wXH_NrDmqZVJ; Mon, 22 May 2023 15:15:43 +0000 (UTC) Received: from smtpclient.apple (unknown [165.140.184.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 07F0569FD4; Mon, 22 May 2023 15:15:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1684768543; bh=PbiAmAmkDjkuayGCdpMd9wiM/Wo5kEHfwRsi65OLGck=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=HDmrwEygehYwJph6k7a2O+ztym7KvaeI+/C4Qqwu+iG6tKTfmpGKkGNpZfd+D1OXn bO1dPQ2HV16Ac1I9+mtq+bXES5OepV/Cd9aULwaUTGo9mn13FRMXnd8PbC0Zf0IQcC vhPM/4Mc37VKMDWKiDzMLbcoWAfAMdIrCvJZY9DmKLuLfwQoGVhD7q7MXu6uMG1I86 hlvzs20qHXTjovto1G/IWNZB9lcUl/XnivtAVd5ZwKiyCoHyHzneKw4/nvGgljeStq l4Mhk6HSgiVJWEQ07CiULA1FYI1XFldE6oyFk0TTu13PfXoce/14FicGpPrsFrcW4C VlR6lXFkzIhXw== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: Partition By Range Without PrimaryKey : Postgresql Version 12.8 on AWS RDS From: Scott Ribe In-Reply-To: Date: Mon, 22 May 2023 09:15:32 -0600 Cc: "pgsql-admin@lists.postgresql.org" , Matti Linnanvuori Content-Transfer-Encoding: quoted-printable Message-Id: <5F09A2FE-117F-47D4-B78B-25023A02AFB7@elevated-dev.com> References: <404AADDB-83F9-4A4A-B6D7-E736C278EFDA@portalify.com> <9558F0D3-4B5B-4CE2-A27F-156149E75916@elevated-dev.com> <2BE78422-2D94-424F-ACA7-1FBAA62D7F5E@elevated-dev.com> To: Phani Prathyush Somayajula X-Mailer: Apple Mail (2.3731.500.231) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On May 22, 2023, at 8:07 AM, Phani Prathyush Somayajula = wrote: >=20 > However, since I was telling other ripple effects, we're trying to = test creating subpartitions by placedon and partitions by brandid like = below. > The reason being : we'll have to archive or purge the data post 90 = days. You could still partition by placedon... Partitioning by brandid is not = much help with rotating out old data. Why the change in primary key? In fact, your primary key in that example = is not guaranteed unique--if I'm reading this correctly there is a = chance of collision. What's wrong with partitioning by placedon, with a primary key of = (betid, placedon)?