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 1m4Eq1-00013K-JF for pgsql-admin@arkaria.postgresql.org; Fri, 16 Jul 2021 03:48:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m4Eq0-00008n-J0 for pgsql-admin@arkaria.postgresql.org; Fri, 16 Jul 2021 03:48:32 +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 1m4Emu-0002r5-RR for pgsql-admin@lists.postgresql.org; Fri, 16 Jul 2021 03:45:20 +0000 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m4Emp-0006Yi-DZ for pgsql-admin@lists.postgresql.org; Fri, 16 Jul 2021 03:45:19 +0000 Received: by mail-ot1-x335.google.com with SMTP id 42-20020a9d012d0000b02904b98d90c82cso8519683otu.5 for ; Thu, 15 Jul 2021 20:45:15 -0700 (PDT) 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=uy6Vy1vwNb2lK8o83j/vM1IoAS2hOHfiNNPA9LkBV4o=; b=E0due1olP1M3FiP1KRP67cZiZDK8DS7iK1fbRYYrOOk2QfUemcX93fa3FxyGup81Kj TTJelAYc6MVR0GreLzhw7uEXNHhafPjrkrbIjPjYuw7ENRV2LgXpacT8V7NYLFpzW60/ 9GyzcHTee/XukNt8xg1MFq7XKsQn6yOgnrGxV5Wf4wf8Ar9q4ZQSWEj2e+uAPrArBc2y N9ChbhibCjSfATRKqKMvaeMoC5Ly4yJbMxJo0o+TohpoXZsWLJPdEIygRJDg9Rq2nSIE rUUzM7aTtZ1rNoM65ilZZ88IinSSBweWOpR2cAMINRn1z+gMpc44g/SS/36RQblVvgwx GASA== 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=uy6Vy1vwNb2lK8o83j/vM1IoAS2hOHfiNNPA9LkBV4o=; b=KC9deBU88Gd8IQWSMbHS8A/uvAREI8I/EhoUNmnGKm4NvZ5RSAVr60Qjd21c3vkoY4 hw6t1jVEO5YrG/S6DwRFwFE5E3UUX091nF9TIv1kJVHkrVs91BTZ0Olg1cc5KmDe53n9 NMBuQfZpYdH/TLyMW/RSppzAI5Lz7LWvBti2AuYsE9ALTxxlrgaarZYAmGbVWgcm1C3k 0Wt5Luxj3VG+fhzSOpqWLK0JAKFbYAHhB5Q389dozXa79VTnx1oZ8OjLPU+JA7uZGeNR KefoyBp8oGaZfl0kOx2zgADxGdWZ37X6N7Fg0ueZ9AhWa28KtsNdZbpanm6pq27fokvo HZgw== X-Gm-Message-State: AOAM530gvsv9eOINeigpoAeLSbNChMiYM9M1Ls++PC7Pxo/EfJcL+jgg DGPcnSoaLLqitfDgChLRZmnJjf0FKLI= X-Google-Smtp-Source: ABdhPJygpMyYj+pn0JnXfW2QuET34w3sk/2srdpxeU1eIs/5EsfKXPO39XIHrtp1rS6zITPYY7iOzA== X-Received: by 2002:a9d:638d:: with SMTP id w13mr6351911otk.224.1626407114167; Thu, 15 Jul 2021 20:45:14 -0700 (PDT) Received: from [192.168.88.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id b11sm1565853oti.30.2021.07.15.20.45.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Jul 2021 20:45:13 -0700 (PDT) Subject: Re: Partitioning on the date part of a timestamp & PK issues To: pgsql-admin@lists.postgresql.org References: <202107160253.va6esfntkuxr@alvherre.pgsql> From: Ron Message-ID: Date: Thu, 15 Jul 2021 22:45:12 -0500 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: <202107160253.va6esfntkuxr@alvherre.pgsql> 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: Archived-At: Precedence: bulk On 7/15/21 9:53 PM, Alvaro Herrera wrote: > On 2021-Jul-15, Ron wrote: > >> CREATE TABLE t ( >>     guid uuid not null, >>     seq smallint not null, >>     tid smallint not null, >>     ts timestamp without time zone not null, >>     x real, >>     y real, >>     z real, >>     primary key (guid, tid, seq, ts) >> )   partition by range (ts); > This definition will let you have multiple rows for the same > (guid,tid,seq) combination, as long as they have different ts values. > That is at odds with the original formulation, in which there could be a > single row with any given combination of those three columns. That's the cost of partitioning by something other than uid, tid or seq. -- Angular momentum makes the world go 'round.