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 1vC9yR-009lR3-JL for pgsql-performance@arkaria.postgresql.org; Fri, 24 Oct 2025 05:04:22 +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 1vC9yQ-00DnRa-HH for pgsql-performance@arkaria.postgresql.org; Fri, 24 Oct 2025 05:04:21 +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 1vC9yQ-00DnRS-7C for pgsql-performance@lists.postgresql.org; Fri, 24 Oct 2025 05:04:21 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vC9yN-003TcH-1D for pgsql-performance@lists.postgresql.org; Fri, 24 Oct 2025 05:04:20 +0000 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-378d6fa5aebso17218911fa.2 for ; Thu, 23 Oct 2025 22:04:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1761282258; x=1761887058; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=btFs9Jbb12WwXNRNRYRdEI2ZYOUSktDM8LgEovt/TTY=; b=ktzxa7Mi4ZAjOT2orNai/exTiJ+GvXYW7/5onCawLAKuNkeBLmq8sRB46HgvuUS6hD LCqjUwh7idEIEvxLr1hLBh5X0AbbZE0q58WuHabh/mvTiDBynfHvCCdDnnpjpqqvxpcC n4DMshxFIY33u8lR0LyJ8jMCt23RJtAZFc1lpRJCA7PFnnvHPCP6N/0P6IO7q9s83cCR K1D1NPX33DUyDeyu+agiEL5deBGy+igbpFWakBA4s9Y6E/oa0Q9AgYjOd0uaK4xVEW8n eRics0gD94OI2zUNrVkQbi/veIB6v6SiCSR3D/A59YcC00qIz6S4axRKCsPmmR3ithVc dCSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761282258; x=1761887058; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=btFs9Jbb12WwXNRNRYRdEI2ZYOUSktDM8LgEovt/TTY=; b=FaFuzJlsXAjWJUYJV3isHOB5CXW0Lm6iou1xXL6f6iei+aqhtPVpIUVmEtfXSZOZCi VgquPbF1zourIw2MprrnyerO2JciY5DgKtPDJm5sU8LAOvgSHyS9+hODJMDB5hGl2j4U 5jBsAtOmkZZAlcxTT4b0cvKniPOwASG2vyC12LdF1KEuEgqgIWYGkXqlqBueh+SWzTuJ NLjoB7QXT23YYiDRlb3T8KBA9TkMa00mlCQbbgHRCKH2d81IUvRGFHq8q+htcgKk4MTP azRBsqNtqFhD8KAD7s/qYFtjIZqCi4RvGbE+B2TfNaZ+M2OAQb9R//EKRU78iRhHZUgc wHFA== X-Forwarded-Encrypted: i=1; AJvYcCXiOKlRFak04AV/N9hT8umChHcmVvgvGkHsReIZbnFm5VkwLyJ6O/tYPCdarpCBBoejWlTJ3bkzW+uCDLhCVZ/FnA==@lists.postgresql.org X-Gm-Message-State: AOJu0YxImUAksBLwnAxFMj1jB1TSpulCSxUgFlcTD7DpDoVSFWBV5hr0 tLWeFcB+oFrlP99alLOP/WGtyWGyr4JEWq5xanZp/xpm2cV2B8XBS74BzPOxLVBN2qY= X-Gm-Gg: ASbGncuYIVF6UpNtIwkabGnIqPAMO0hRpGAuQVvlQ21tcpoh3icZKkSublYHcSeIGG8 euD0Brk600Bj2goB3hOpjfaMGWXW8M/JQxMbE5Q9ZZQHX7lna39JwZsbaiDzs8PaehnmsRFywsh Sg/X16rAhyb/KEBxFwPamC8C/wlMHGekd2BFZoOhvQBH3R30CQig+//EtasuvUzSWloDchA8JKu AMbE/pGaIwuhCOM2Zpg6Qj+OcnNQwqZl3/qOviDmKpV/yTzQpl76FkLvjDSQSVxqmbLbP7p25xj SxZKUfI0CnUSwCLlIoYiyN8KzBg8JbUb4N3Q6mdFCB4JOxR+hRWBffGjgHPptuh05HXdxVXtcsk cdiWYwWc1Rm4hfMyP3+VajRWkFDlKO5uXK+h1TReeaQbuQgT2DwIS7bYtTdUOetoRBD83O8MaDI cve+Xjlp415rSEvQODYCMbBIXJtZn5fH+Cg6zPeyBtnw== X-Google-Smtp-Source: AGHT+IHEUi0NirzE2bJ27clXW3L4aHFZFrb0eg+UIoapaPa0RD5KDT5L3jPXYLndqktZDaszTATLhA== X-Received: by 2002:a2e:be1d:0:b0:378:cff9:937 with SMTP id 38308e7fff4ca-378d6d1c167mr16800741fa.32.1761282257545; Thu, 23 Oct 2025 22:04:17 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([159.148.223.130]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-378d67dc640sm8166231fa.40.2025.10.23.22.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Oct 2025 22:04:17 -0700 (PDT) Message-ID: Subject: Re: Performance implications of partitioning by UUIDv7 range in PostgreSQL v18 From: Laurenz Albe To: David Rowley Cc: Jonathan Reis , Greg Sabino Mullane , Olof Salberger , pgsql-performance@lists.postgresql.org Date: Fri, 24 Oct 2025 08:04:16 +0300 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-2.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2025-10-24 at 11:54 +1300, David Rowley wrote: > On Fri, 24 Oct 2025 at 09:38, Laurenz Albe wro= te: > > I recommend that you create a primary key on each partition rather than= having one > > on the partitioned table. >=20 > It might be worth mentioning that doing that would forego having the > ability to reference the partitioned table in a foreign key > constraint. Right, but referencing a partitioned table with a foreign key is a mixed bl= essing anyway: you could no longer drop partitions from the partitioned table with= out scanning the referencing table to verify that the foreign key is not violat= ed. Yours, Laurenz Albe