C
Charles
Hello
Would anyone have some light on this question: how critical is the
type of the field used as an index for a large database.
Let's say I have 1 million entries, every entry has a field called
"Reference" which contains a 10-11 characters string. This string is
not unique and I sometimes want to select all entries with a specific
reference out of the 1 million entries. Reference is naturally
indexed.
How faster do you think it would be to have another table mapping
every reference to a "Reference ID" which would be an integer, and to
have in the 1m table not the Reference but a Reference ID. In other
worlds, how faster is it to run a query on an indexed string (SELECT
FROM WHERE Reference="UEJ22554EE") and an indexed integer (SELECT FROM
WHERE ReferenceID=15455) on a massive 1m table.
Is it worth the pain of having extra tables?
Thanks in advance
Charles
Would anyone have some light on this question: how critical is the
type of the field used as an index for a large database.
Let's say I have 1 million entries, every entry has a field called
"Reference" which contains a 10-11 characters string. This string is
not unique and I sometimes want to select all entries with a specific
reference out of the 1 million entries. Reference is naturally
indexed.
How faster do you think it would be to have another table mapping
every reference to a "Reference ID" which would be an integer, and to
have in the 1m table not the Reference but a Reference ID. In other
worlds, how faster is it to run a query on an indexed string (SELECT
FROM WHERE Reference="UEJ22554EE") and an indexed integer (SELECT FROM
WHERE ReferenceID=15455) on a massive 1m table.
Is it worth the pain of having extra tables?
Thanks in advance
Charles