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 1kcz44-0002SE-Nu for pgsql-general@arkaria.postgresql.org; Wed, 11 Nov 2020 22:58:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kcz42-0004Xf-32 for pgsql-general@arkaria.postgresql.org; Wed, 11 Nov 2020 22:58:06 +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 1kcz41-0004XY-Ok for pgsql-general@lists.postgresql.org; Wed, 11 Nov 2020 22:58:05 +0000 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kcz3z-0007r7-DK for pgsql-general@lists.postgresql.org; Wed, 11 Nov 2020 22:58:04 +0000 Received: by mail-oi1-x229.google.com with SMTP id o25so4129140oie.5 for ; Wed, 11 Nov 2020 14:58:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=i6qa7bh5t4n4oDBuxu2IvjpAPovfH4ibHzGpTCzK00o=; b=Qzo9GSqzjS4m49x1ubuj/aiu503L1WdKBxK+f+BAeBHzfUYpf5H4+q4kQUWCQllTbm ariFLz4s69NLc45CP4vcewHBq1uZ5gfKKi+abvpWW4eGD8PB4Sg5I+D3VDBJdOWzFuNo fjvedM96NNQKLjFbXARxxm1+JYB8EUxMIzRVyEs+Uvf9wH7BmAdA1gqo8iT8XcG5CtyT toAnE9jt1G1vFru67Kf5qcIPTqplIAQlL7NXjdXcKxktXGmYSiIf4/GH5sQRQy5vr6Yc RZbxxssuaWtqpnbjiQxUADTGWlUSAHhffJF4Ni7Dckoymr3kHd84VFil2Y1sHyZcmN9S WXzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=i6qa7bh5t4n4oDBuxu2IvjpAPovfH4ibHzGpTCzK00o=; b=Mom7cB7mnMnYsJlHLJrMdBn5qX8DhN1fU9VosQDs6VL8z28PzWB23Q7TT7sJE0EgfL ndim2m5wi5siNcF5pg36r3Ctx0DKtgl3yuaVRSx2znEnVeD6xTSXANcxfeHKfktDcfZJ wMoszhAZoPlYXWvjsv5NpO09HUFTCBWBtyEF/o9LEYBPRt3/Z7ZSsU9BAM+glaR1BeGB v4TDkuJQkF++1iwiCirEGKyx9LnO8H/SEekr2NcWP9Ha7ivRdZ6hkbFqxhPs7b3bSBch nU2sJrPhgfHnMwb2wWS6Vs8/oiVaG1qjgyhrIpl8yvNyBa4L1RB8i5lcOJRHzH/4EJKT wKfw== X-Gm-Message-State: AOAM533+a39CvhHSvxI4ruLuf4MvuiLed1zwWiKv2EZx3UenHpPjW1W5 OtJAsWgQcoMph2ImxTLee8WjSAUtwoKcUg== X-Google-Smtp-Source: ABdhPJxpO5CK8iUne45bqkn4uQKzLyUGCBZOSoGBD1ihYfVnHOfZ3BB3GccBBa+TL0KtwLZr9yZ5OA== X-Received: by 2002:a05:6808:605:: with SMTP id y5mr3639923oih.63.1605135481905; Wed, 11 Nov 2020 14:58:01 -0800 (PST) Received: from [192.168.1.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id o29sm833569ote.7.2020.11.11.14.58.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Nov 2020 14:58:01 -0800 (PST) Subject: Re: identify partitioning columns and best practices of partitioning in prod enviornments To: pgsql-general@lists.postgresql.org References: From: Ron Message-ID: <921baf8a-195b-fb45-292f-2618f5088302@gmail.com> Date: Wed, 11 Nov 2020 16:58:00 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/11/20 4:31 PM, Atul Kumar wrote: > Hi, > > I want to about best practices of partitioning in prod environments > and how to identify partitioning columns. It depends on what you want to do.  If your purpose is to simplify the deletion of old records, then partition by an unchanging date field. If your purpose is to increase locality of data (because many of your queries are an equality on a specific "group id"), then partition by that "group id" field. -- Angular momentum makes the world go 'round.