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 1jLCCR-0001ta-03 for pgsql-performance@arkaria.postgresql.org; Sun, 05 Apr 2020 20:48:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jLCCP-0003NQ-NE for pgsql-performance@arkaria.postgresql.org; Sun, 05 Apr 2020 20:48:57 +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 1jLCCP-0003NJ-Fr for pgsql-performance@lists.postgresql.org; Sun, 05 Apr 2020 20:48:57 +0000 Received: from fairwindsoft2.fairwindsoft.com ([162.249.6.50]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jLCCM-0001sS-4H for pgsql-performance@lists.postgresql.org; Sun, 05 Apr 2020 20:48:57 +0000 Received: from [172.16.1.215] (c-73-3-0-227.hsd1.mo.comcast.net [73.3.0.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: neil) by fairwindsoft2.fairwindsoft.com (Postfix) with ESMTPSA id 7BD3D967; Sun, 5 Apr 2020 15:48:50 -0500 (CDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Postgresql 12, 512 partition by hash. Slow select From: Neil In-Reply-To: Date: Sun, 5 Apr 2020 15:48:49 -0500 Cc: Tom Lane , pgsql-performance@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <4C8D8AB5-A545-4965-BA52-FC33D0C88A0F@fairwindsoft.com> References: <31605.1586112900@sss.pgh.pa.us> To: Arya F X-Mailer: Apple Mail (2.3273) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Apr 5, 2020, at 2:50 PM, Arya F wrote: >=20 > The table at some point will have more than 1 billion rows, the > information stored is international residential addresses. Trying to > figure out a way of spreading the data fairly evenly thought out > multiple partitions, but I was unable to come up with a way of > splitting the data so that Postgres does not have to search though all > the partitions. >=20 If you have to use partitions, I would split it by country using = population for analysis. I understand that address and population are = different, but I would expect some correlation.=20 The largest 14 countries each have a population of 100 million or more = and represent about 62% of the world population. That means the rest of = the world should fit easily into another 14 partitions.=20 It seems like it could be fairly easily evened out with a little bit of = data analysis. You could probably refine this to be no more than 20 partitions. Now China and India could be a problem and need to be split, but I would = not do that unless necessary. China and India both have 6 nationally = recognized regions that could be used if needed. Neil - Fairwind Software https://www.fairwindsoft.com