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 1jd52w-0000NO-CH for pgsql-performance@arkaria.postgresql.org; Mon, 25 May 2020 04:49:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jd52N-0000Vj-2v for pgsql-performance@arkaria.postgresql.org; Mon, 25 May 2020 04:48:31 +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 1jd52M-0000VR-SA for pgsql-performance@lists.postgresql.org; Mon, 25 May 2020 04:48:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jd52J-0002TT-88 for pgsql-performance@lists.postgresql.org; Mon, 25 May 2020 04:48:29 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 04P4mNe4012136; Mon, 25 May 2020 00:48:23 -0400 From: Tom Lane To: Cedric Leong cc: pgsql-performance@lists.postgresql.org Subject: Re: Date vs Timestamp without timezone Partition Key In-reply-to: References: Comments: In-reply-to Cedric Leong message dated "Sun, 24 May 2020 23:50:05 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12134.1590382103.1@sss.pgh.pa.us> Date: Mon, 25 May 2020 00:48:23 -0400 Message-ID: <12135.1590382103@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Cedric Leong writes: > Just in case someone is interested enough to answer this. Does anyone know > if the performance for a date column vs a timestamp column as a partition > key is large? I doubt it's even measurable, at least on 64-bit machines. You're basically talking about 32-bit integer comparisons vs 64-bit integer comparisons. On a 32-bit machine it's possible that an index on a date column will be physically smaller, so you could get some wins from reduced I/O. But on (most?) 64-bit machines that difference goes away too, because of alignment restrictions. As always, YMMV; it never hurts to do your own testing. regards, tom lane