Re: data model one large and many small columns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My immediate response is that if you know at the time you build the query and exclude the BLOB/text, it _should_ be immaterial, but inserts might suffer in and single table based on indexes.

Discussion?




-------- Original message --------
From: "Campbell, Lance" <lance@xxxxxxxxxxxx>
Date: 07/26/2016 3:24 PM (GMT-06:00)
To: pgsql-admin@xxxxxxxxxxxxxx
Subject: data model one large and many small columns

PostgreSQL 9.5.3

 

Suppose you have a table that consists of a lot of small sized columns with one really large text column.  The text column represents an average sized web page.  When inserting or updating you will work with only one row at a time. 

 

When selecting information you will either:

A)     select all columns in one row for display or editing purposes. 

B)      Or you will select hundreds of rows but NOT the very large text column.

 

Question: Is there any performance to be gained from PostgreSQL by storing the data as two tables versus one table?  In the two table model you would put the large column in a secondary table with a foreign key back to the primary table.  So each table would have a one to one relationship.  In the two table model when you need a single record with everything you would select from both tables based on a key.  When selecting hundreds of rows at one time you would only select from the primary table.

 

I know there is this concept of TOAST.  I don’t know if it even matters to PostgreSQL if I had two separate tables or just one.

 

Thanks for your insight.

 

Lance

 

 



Journyx, Inc.
7600 Burnet Road #300
Austin, TX 78757
www.journyx.com

p 512.834.8888 
f 512-834-8858 

Do you receive our promotional emails? You can subscribe or unsubscribe to those emails at http://go.journyx.com/emailPreference/e/4932/714/ 

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux