This might be a general RDBMS question but since I'm using sqlite specifically, I hope it passes basic relevancy tests.

I have a table defined as:

CREATE TABLE "CPUModelDictionary" (
        `vendor_id`     TEXT,
        `cpu_family`    INTEGER,
        `cpu_model`     INTEGER,
        `cpuid_level`   INTEGER,
        `cpu_model_name`        TEXT,
        `cpu_cores`     INTEGER,
        `cpu_MHz`       INTEGER
);
CREATE INDEX `idx_CPUModels` ON `CPUModelDictionary` (
        `cpu_family`,
        `cpu_model`,
        `cpuid_level`,
        `cpu_cores`,
        `cpu_MHz`
);

that contains rows like this:

'GenuineIntel',6,62,13,'Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz',8,2620
'GenuineIntel',6,63,15,'Intel(R) Xeon(R) CPU E5-2640 v3 @ 2.60GHz',8,2600
'GenuineIntel',6,79,20,'Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz',8,1200

The five fields used in the index create a unique identifier.

I want to reference these rows via a single reference field but I'm not sure if there's a "smarter" way to do it. I considered just creating a field that's a concatenation of the five fields and using that as the unique link to the rows but I'm sure that it's not the best way to do it.

(The objective is to have a single field in another table that identifies the CPU used in a system. It will be a many-to-one reference to this CPUModel.)

Any advice? Pointers to documentation offering advice will help too.

Thanks for everyone's time.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to