Alex Rivera | Logout

Is there ever a time where using a database 1:1 relationship makes sense?

Asked 2009-02-05T19:08:42.630
192

I was thinking the other day on normalization, and it occurred to me, I cannot think of a time where there should be a 1:1 relationship in a database.

  • Name:SSN? I'd have them in the same table.
  • PersonID:AddressID? Again, same table.

I can come up with a zillion examples of 1:many or many:many (with appropriate intermediate tables), but never a 1:1.

Am I missing something obvious?

Edit
Report

4 Answers

54

Sparseness. The data relationship may be technically 1:1, but corresponding rows don't have to exist for every row. So if you have twenty million rows and there's some set of values that only exists for 0.5% of them, the space savings are vast if you push those columns out into a table that can be sparsely populated.

answered 2009-02-05T19:16:10.680
14

The most common scenario I can think of is when you have BLOB's. Let's say you want to store large images in a database (typically, not the best way to store them, but sometimes the constraints make it more convenient). You would typically want the blob to be in a separate table to improve lookups of the non-blob data.

answered 2009-02-05T19:27:43.200
9

Rather than using views to restrict access to fields, it sometimes makes sense to keep restricted fields in a separate table to which only certain users have access.

answered 2009-02-05T19:14:00.247
9

1-1 relationships are also necessary if you have too much information. There is a record size limitation on each record in the table. Sometimes tables are split in two (with the most commonly queried information in the main table) just so that the record size will not be too large. Databases are also more efficient in querying if the tables are narrow.

answered 2009-02-05T20:04:51.877

Your Answer