Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vC7KY-009D5n-7l for pgsql-performance@arkaria.postgresql.org; Fri, 24 Oct 2025 02:15:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vC7KX-00D82L-1O for pgsql-performance@arkaria.postgresql.org; Fri, 24 Oct 2025 02:15:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vC7KW-00D82D-FB for pgsql-performance@lists.postgresql.org; Fri, 24 Oct 2025 02:14:59 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vC7KS-003SQu-21 for pgsql-performance@lists.postgresql.org; Fri, 24 Oct 2025 02:14:58 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-586883eb9fbso1773329e87.1 for ; Thu, 23 Oct 2025 19:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conevity-com.20230601.gappssmtp.com; s=20230601; t=1761272094; x=1761876894; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=TQ4ZGgFBB06M+6eUuvFQWEks0gjVFsAJU6LnL6+HTMA=; b=g+cYzMxO8aPrpFkR3rXqz/C1ptZgt0IrBo7YvTfe3qhhHfTgIQYLQu+4uXlSSxDk/v 0dJ6/ttAboKh1JH3VWKpppioIbZjDRp105SJYjClIovJeAvNdxB0gAETdJC6MfpHL86V S5xnb0hLMbSVUqfMPe3NpSSe4xKPuF9SlOtKagwFi4tKASMirW47h1DnLtdc+8xf54Vl r3YShGbOQVXimcHpz6OEWhfdiVJPcw+x40tMxQLJVCzWJnDDPhSjNht9gCajvHl6ZgoV MCPSCyDAquj/e28b/+Xb0L5023YAuDfgZ1BX50DsWfUrE2T4PGVTcnSAsqglMd1AXhyr YJVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761272094; x=1761876894; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TQ4ZGgFBB06M+6eUuvFQWEks0gjVFsAJU6LnL6+HTMA=; b=S+EJgtJnz9cl9K1MiXLkT1CO1RTyZ7KxbpsDh5eEqXzx3MQUovx/B4N8QBL3pURtF4 GSO7RQEcQ9y66CoOAsYd+ugwWZVcjlQ+Nit0Up0nFGGhd+7j7/QYe7QToSXS/C5lZ0Ot JLykZzNVhXYq4rzwLxokRerKVuhCbLbZjvtfRDm4eugxEtZT9FYL/7D2n4qp1TFFuvD3 e1yLXla3FKdWhaGe9HyDUgSNqvL/hLTnTjvVvzXp23nmpLySW/01YkGo0F7yM7aN/GIm fbbBYa4Ul8LmKr3OLoGzwur9vzEB+ozDaMKbx6Q3hSl/Ymy0FCWgzvH0H/sMo4q+SRPi IoyA== X-Forwarded-Encrypted: i=1; AJvYcCUxXoMUuF9F1vmk9N+PGntJ98KyQBAA9rc9JfRFPXqZGaTiOQ9GPqUDIdEBtvwPMX7llqMnvL1a5+CyewAWjFK9bQ==@lists.postgresql.org X-Gm-Message-State: AOJu0Yyah21g3H7xe5J7r0L7cEQAwXa7q79bRfgx0y4PRYsaEukB1tvX I+UVmE3qFA9MEaId+xofuWEdsr1D1+toFV0R534BWiyzTsahy+794l4tHcxAPK0ef6T3IEeuTGd jKhPCCLo= X-Gm-Gg: ASbGncuHiRXBssyoSFklxHP3T6ByNXPJjgniqniRc5GDLhIUk7CeuiQbmaZXQVeY3FV eHP6qwdUrnJDX+zhxfedMiPxquW430DNF7e0rWehaQIPGn3nyZ8Ws5kzGjD0osPoyylQVveqnE4 w3fe893GkXxq+AhWSgLISwuhoLUOn0fetVY6Oo4UgWc2rqxPkOfbtfVP7o5w80nKhcsssVec4Lx dQmRBC8Vx0GgG/rB5Ua3tol8fEiARMMCg10iGKDh4nz5pVzh6d75vaxJpMHhDLmlJ444cbtDcxS l9dDkp+cEIczF+VsEX1acp4WzRLZZDIJSsFCzUXVPzf7TUpOwc79Izbf7QSiD4FepRmh1AlcLUJ 9XxYj3avEuNIOp5zZW8MX5vv7bD5nZF1qGnjPVU4mob3+NfmPQBLyL2WQYs8MxpBBVafJPheM+S TLkMz7YrzD9+n7hais5FFGkeQTqOJ93ApJZxxJzDk= X-Google-Smtp-Source: AGHT+IHiFbAIZrxSxgrRn6ujpwWUmcc+M6C1LmE1bHoVXVfQX3/4ams+H/Y7dseJ9ZpiRRc547lbmQ== X-Received: by 2002:ac2:4f03:0:b0:579:ac00:1f20 with SMTP id 2adb3069b0e04-591d84cef68mr8229903e87.2.1761272093277; Thu, 23 Oct 2025 19:14:53 -0700 (PDT) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com. [209.85.167.51]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-592f4cd1bd6sm1205467e87.33.2025.10.23.19.14.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Oct 2025 19:14:52 -0700 (PDT) Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-57a292a3a4bso1949270e87.3 for ; Thu, 23 Oct 2025 19:14:52 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUbG3hdquBK8/em6GnJDKZ2pPKv89JpbI70RgGkhk8vGwOUhOLWjL42MKFpgodTrUtm65Gbm4R7lE/1Zos8xxzuNA==@lists.postgresql.org X-Received: by 2002:a05:6512:63cb:b0:591:ec59:2d3f with SMTP id 2adb3069b0e04-591ec5934a4mr2754437e87.19.1761272092082; Thu, 23 Oct 2025 19:14:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Reis Date: Thu, 23 Oct 2025 19:14:15 -0700 X-Gmail-Original-Message-ID: X-Gm-Features: AS18NWDV6c7vcBXFgTJKHOPIYN62FE-Ez7qPEL7mHdK00du2XvATGVUb27pk9Gk Message-ID: Subject: Re: Performance implications of partitioning by UUIDv7 range in PostgreSQL v18 To: David Rowley Cc: Laurenz Albe , Greg Sabino Mullane , Olof Salberger , pgsql-performance@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000066c8430641de1d82" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000066c8430641de1d82 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you all for your input on this. Here is a summary of what I have learned from you all. Approach 1: partition on uuid_extract_timestamp(id) Pros: No need for custom function to convert from timestamptz to uuidv7 Partitions are human-readable Can use pg_partman Cons: Cannot have a primary key on id Cannot use foreign keys Approach 2: partition on id Pros: Can have a primary key on id Can have foreign key constraints Cons Require custom function to convert from timestamptz to uuidv7 Partitions ranges must be decoded to be human-readable Can't use pg_partman (this is true?)