Subject | what schema is better ? |
---|---|
Author | Vander Clock Stephane |
Post date | 2010-12-09T16:30:16Z |
Hello,
I have a table with Millions of rows. what structure is better :
Table ZillionRows (
OBJECTID integer not null,
RANK smallint not null,
SERVER_ID integer not null,
VOLUME_ID smallint not null,
ID integer not null,
KEY longint not null,
PRIMARY KEY OBJECTID, RANK
);
or
Table ZillionRows (
OBJECTID integer not null,
RANK smallint not null,
NAME VARCHAR 18 NOT NULL,
PRIMARY KEY OBJECTID, RANK
);
you understand in the second case i simply concat
SERVER + VOLUME_ID + ID + KEY in a VARCHAR Field
i select the rows only like this
select * from ZillionRows where OBJECTID=xxx;
I have a table with Millions of rows. what structure is better :
Table ZillionRows (
OBJECTID integer not null,
RANK smallint not null,
SERVER_ID integer not null,
VOLUME_ID smallint not null,
ID integer not null,
KEY longint not null,
PRIMARY KEY OBJECTID, RANK
);
or
Table ZillionRows (
OBJECTID integer not null,
RANK smallint not null,
NAME VARCHAR 18 NOT NULL,
PRIMARY KEY OBJECTID, RANK
);
you understand in the second case i simply concat
SERVER + VOLUME_ID + ID + KEY in a VARCHAR Field
i select the rows only like this
select * from ZillionRows where OBJECTID=xxx;