In article <33c6269f0802032014i3878ec3co4488b4835ef1e3d8@mail.gmail.com>,
Alex Turner <armtuk@gmail.com> 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@interlog.com