Subject: Re: Arrays vs separate tables

From: Rich Shepard <[email-masked]>
Date: Mon, 20 Oct 2025 05:55:33 -0700 (PDT)

On Mon, 20 Oct 2025, Peter J. Holzer wrote:

> * Simplicity: If a set of values is always fetched together and updated
>  together, you might as well treat it as a unit and not split it over
>  multiple tables

> The second may be relevant for you. If you always display and edit the
> phone numbers of a contact together and your frontend makes it easier to
> edit an array than a subset of rows from a table, you might just stuff
> them into a table and ignore "purity".

Peter,

Thank you. That's my use case.

Regards,

Rich

---

From: Michał Kłeczek <[email-masked]>
Date: Mon, 20 Oct 2025 15:38:21 +0200

> On 20 Oct 2025, at 14:55, Rich Shepard <[email-masked]> wrote:
> 

There is also another concern - do you want to make sure phone numbers are not shared?

—
Michal

---

From: Rich Shepard <[email-masked]>
Date: Mon, 20 Oct 2025 07:07:36 -0700 (PDT)

> There is also another concern - do you want to make sure phone numbers are

Michal,

Shared with whom? I run a solo professional services consultancy so there's
only me here the database.

Rich

---

From: Michał Kłeczek <[email-masked]>
Date: Mon, 20 Oct 2025 16:21:09 +0200

> On 20 Oct 2025, at 16:07, Rich Shepard <[email-masked]> wrote:
> 
> Shared with whom?

Sorry, I wasn’t clear.

How do you make sure a phone number is not shared by two (or more) customers?

—
Michal

---

From: Ron Johnson <[email-masked]>
Date: Mon, 20 Oct 2025 10:25:43 -0400

On Mon, Oct 20, 2025 at 10:07 AM Rich Shepard <[email-masked]>
wrote:

> > There is also another concern - do you want to make sure phone numbers
> are
> > not shared?
>
> Michal,
>

Multiple contacts at the same client company.  If, for whatever reason, the
phone number changes you've got to update X rows in your contacts table,
whereas only one row needs to be updated when the schema meets 1NF.  This
eliminates update anomalies.

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

---

From: Rich Shepard <[email-masked]>
Date: Mon, 20 Oct 2025 07:25:56 -0700 (PDT)

Michal,

If it's the company's main telephone number then it's shared by all
employees with phones on their desks. If it's a direct number then it
connects to only a single phone.

Either way it doesn't matter to me. When the person I call is at their desk
my call will either be transferred by the receptionist or directly ring their
phone.

Rewgards,

Rich

---

From: Adrian Klaver <[email-masked]>
Date: Mon, 20 Oct 2025 07:42:01 -0700

> only me here the database.

That is the heart of the matter, you should do what makes sense to you. 
If you can get the information you need in the manner you want then 
don't change things. Given the size of your datasets I don't see that 
changes will materially affect the performance of your queries. I am 
pretty sure most of the time the Postgres planner is resorting to a 
sequence scan anyway.

-- 
Adrian Klaver
[email-masked]

---

From: Rob Sargent <[email-masked]>
Date: Mon, 20 Oct 2025 08:48:10 -0600

> On Oct 20, 2025, at 8:42 AM, Adrian Klaver <[email-masked]> wrote:
> 
> That is the heart of the matter, you should do what makes sense to you. If you can get the information you need in the manner you want then don't change things. Given the size of your datasets I don't see that changes will materially affect the performance of your queries. I am pretty sure most of the time the Postgres planner is resorting to a sequence scan anyway.

And all the hot tables have been paged in if not the entire db.