Re: Primary keys and composite unique keys(basic question)

2021-04-08 Thread Peter J. Holzer
On 2021-04-07 10:35:55 -0600, Rob Sargent wrote: > On Apr 7, 2021, at 10:17 AM, Ron wrote: > > On 4/5/21 9:37 PM, Rob Sargent wrote: > > It's a small thing, but UUIDs are absolutely not memorizable by > humans; they have zero semantic value. Sequential numeric >

Re: Primary keys and composite unique keys(basic question)

2021-04-07 Thread Ron
On 4/7/21 1:16 PM, Rob Sargent wrote: On 4/7/21 11:59 AM, Ron wrote: On 4/7/21 11:35 AM, Rob Sargent wrote: On Apr 7, 2021, at 10:17 AM, Ron wrote:  On 4/5/21 9:37 PM, Rob Sargent wrote: It's a small thing, but UUIDs are absolutely not memorizable by humans; they have zero semantic value.

Re: Primary keys and composite unique keys(basic question)

2021-04-07 Thread Rob Sargent
On 4/7/21 11:59 AM, Ron wrote: On 4/7/21 11:35 AM, Rob Sargent wrote: On Apr 7, 2021, at 10:17 AM, Ron wrote:  On 4/5/21 9:37 PM, Rob Sargent wrote: It's a small thing, but UUIDs are absolutely not memorizable by humans; they have zero semantic value.  Sequential numeric identifiers are ge

Re: Primary keys and composite unique keys(basic question)

2021-04-07 Thread Ron
On 4/7/21 11:35 AM, Rob Sargent wrote: On Apr 7, 2021, at 10:17 AM, Ron wrote:  On 4/5/21 9:37 PM, Rob Sargent wrote: It's a small thing, but UUIDs are absolutely not memorizable by humans; they have zero semantic value.  Sequential numeric identifiers are generally easier to transpose and

Re: Primary keys and composite unique keys(basic question)

2021-04-07 Thread Rob Sargent
> On Apr 7, 2021, at 10:17 AM, Ron wrote: > >  On 4/5/21 9:37 PM, Rob Sargent wrote: >>> It's a small thing, but UUIDs are absolutely not memorizable by >>> humans; they have zero semantic value. Sequential numeric identifiers >>> are generally easier to transpose and the value gives some clu

Re: Primary keys and composite unique keys(basic question)

2021-04-07 Thread Ron
On 4/5/21 9:37 PM, Rob Sargent wrote: It's a small thing, but UUIDs are absolutely not memorizable by humans; they have zero semantic value.  Sequential numeric identifiers are generally easier to transpose and the value gives some clues to its age (of course, in security contexts this can be a d

Re: Primary keys and composite unique keys(basic question)

2021-04-05 Thread Merlin Moncure
On Mon, Apr 5, 2021 at 9:37 PM Rob Sargent wrote: > > It's a small thing, but UUIDs are absolutely not memorizable by > humans; they have zero semantic value. Sequential numeric identifiers > are generally easier to transpose and the value gives some clues to > its age (of course, in security con

Re: Primary keys and composite unique keys(basic question)

2021-04-05 Thread Rob Sargent
> > It's a small thing, but UUIDs are absolutely not memorizable by > humans; they have zero semantic value. Sequential numeric identifiers > are generally easier to transpose and the value gives some clues to > its age (of course, in security contexts this can be a downside). > I take the abo

Re: Primary keys and composite unique keys(basic question)

2021-04-05 Thread Merlin Moncure
On Fri, Apr 2, 2021 at 3:40 AM Laurenz Albe wrote: > > On Thu, 2021-04-01 at 21:28 -0500, Merlin Moncure wrote: > > I would never use UUIDS for keys though. > > That makes me curious for your reasons. > > I see the following disadvantages: > > - A UUID requires twice as much storage space as a big

Re: Primary keys and composite unique keys(basic question)

2021-04-05 Thread Merlin Moncure
On Thu, Apr 1, 2021 at 10:26 PM Rob Sargent wrote: > > On 4/1/21 8:28 PM, Merlin Moncure wrote: > > > > This is one of the great debates in computer science and it is not > > settled. There are various tradeoffs around using a composite key > > derived from the data (aka natural key) vs generated

Re: Primary keys and composite unique keys(basic question)

2021-04-02 Thread Laurenz Albe
On Thu, 2021-04-01 at 21:28 -0500, Merlin Moncure wrote: > I would never use UUIDS for keys though. That makes me curious for your reasons. I see the following disadvantages: - A UUID requires twice as much storage space as a bigint. - B-tree indexes are space optimized for inserting at the r

Re: Primary keys and composite unique keys(basic question)

2021-04-02 Thread Bertrand Mamasam
On Fri, Apr 2, 2021 at 8:57 AM Hemil Ruparel wrote: > I used uuid4 for customer ids because i needed to interface with payment > providers. Is that wrong? All other places except transaction ids, i have > used serial ints > > On Fri 2 Apr, 2021, 8:56 AM Rob Sargent, wrote: > >> On 4/1/21 8:28 PM

Re: Primary keys and composite unique keys(basic question)

2021-04-01 Thread Hemil Ruparel
I used uuid4 for customer ids because i needed to interface with payment providers. Is that wrong? All other places except transaction ids, i have used serial ints On Fri 2 Apr, 2021, 8:56 AM Rob Sargent, wrote: > On 4/1/21 8:28 PM, Merlin Moncure wrote: > > > > This is one of the great debates

Re: Primary keys and composite unique keys(basic question)

2021-04-01 Thread Rob Sargent
On 4/1/21 8:28 PM, Merlin Moncure wrote: This is one of the great debates in computer science and it is not settled. There are various tradeoffs around using a composite key derived from the data (aka natural key) vs generated identifiers. It's a complex topic with many facets: performance, org

Re: Primary keys and composite unique keys(basic question)

2021-04-01 Thread Merlin Moncure
On Wed, Mar 31, 2021 at 3:36 AM Mohan Radhakrishnan wrote: > > Hello, > We have UUIDs in our tables which are primary keys. But in some > cases > we also identify a composite unique key apart from the primary key. > > My assumption is that there should be a unique key index created b

Re: Primary keys and composite unique keys(basic question)

2021-03-31 Thread Michael Lewis
Etiquette on these lists is to reply in line or below the relevant portion, not top-post with full quoting like default gmail behavior. On Wed, Mar 31, 2021 at 9:18 AM Mohan Radhakrishnan < radhakrishnan.mo...@gmail.com> wrote: > But we don't search using UUIDs always. Only when data from another

Re: Primary keys and composite unique keys(basic question)

2021-03-31 Thread Mohan Radhakrishnan
I will cover the UUIDs first. They are indispensable to us. 1. The data is distributed over regions So we need the row to be unique. 2. This distributed data is sent to services as events. That is the application architecture. But we don't search using UUIDs always. Only when data from another dis

Re: Primary keys and composite unique keys(basic question)

2021-03-31 Thread Tom Lane
Mohan Radhakrishnan writes: > We have UUIDs in our tables which are primary keys. But in > some cases > we also identify a composite unique key apart from the primary key. > My assumption is that there should be a unique key index created by us > using the composite key. And when we