Search Postgresql Archives

Re: [OT] "advanced" database design (long)

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

 



In article <33c6269f0802032014i3878ec3co4488b4835ef1e3d8@xxxxxxxxxxxxxx>,
Alex Turner <armtuk@xxxxxxxxx> wrote:
% 
% I"m not a database expert, but wouldn't
% 
% create table attribute (
%   attribute_id int
%   attribute text
% )
% 
% create table value (
%   value_id int
%   value text
% )
% 
% create table attribute_value (
%   entity_id int
%   attribute_id int
%   value_id int
% )
% 
% give you a lot less  pages to load than building a table with say 90 columns
% in it that are all null, which would result in better rather than worse
% performance?

Suppose you want one row of data. Say it's one of the ones where the
columns aren't all nulls. You look up 90 rows in attribute_value, then
90 rows in attribute, then 90 rows in value. You're probably looking at
3-6 pages of index data, and then somewhere between 3 and 270 pages of
data from the database, for one logical row of data.
-- 

Patrick TJ McPhee
North York  Canada
ptjm@xxxxxxxxxxxx

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux