Subject | Re: Expression based index |
---|---|
Author | sasidhardoc |
Post date | 2006-07-20T01:13:57Z |
Adam,
I must admit that you are extraordinarily intuitive. Given the problem
of case insensitive searches, I looked up the release notes - which
states that "Expression indices have exactly the same features and
limitations as regular indices, except that, by definition, they
cannot be composite (multi-segment)." In fact, even the example uses
the same column twice. Then, I proceeded to actually try to create a
multisegment index
RECREATE TABLE DRG_DRUG_ID
(
DRUG_ID INTEGER NOT NULL,
DRUG_NAME VARCHAR( 255) COLLATE NONE,
PRIMARY KEY (DRUG_ID)
);
CREATE UNIQUE ASC INDEX I_DRG_DRUG_NAME ON DRG_DRUG_ID (DRUG_NAME,
DRUG_ID);
CREATE ASC INDEX I_DRG_DRUG_ID_TEST ON DRG_DRUG_ID COMPUTED BY
(upper(DRUG_NAME)||DRUG_ID);
- which actually compiled successfully. Suspecting that I may not
have understood the meaning of the term "composite index" I checked pg
322 of The Firebird Book which states "...it will be of benefit to
create a multi-column index(also known as a composite or complex
index)". If there is a better place to ask this question, please let
me know - I did not think this was a 'bug'.
I must admit that you are extraordinarily intuitive. Given the problem
of case insensitive searches, I looked up the release notes - which
states that "Expression indices have exactly the same features and
limitations as regular indices, except that, by definition, they
cannot be composite (multi-segment)." In fact, even the example uses
the same column twice. Then, I proceeded to actually try to create a
multisegment index
RECREATE TABLE DRG_DRUG_ID
(
DRUG_ID INTEGER NOT NULL,
DRUG_NAME VARCHAR( 255) COLLATE NONE,
PRIMARY KEY (DRUG_ID)
);
CREATE UNIQUE ASC INDEX I_DRG_DRUG_NAME ON DRG_DRUG_ID (DRUG_NAME,
DRUG_ID);
CREATE ASC INDEX I_DRG_DRUG_ID_TEST ON DRG_DRUG_ID COMPUTED BY
(upper(DRUG_NAME)||DRUG_ID);
- which actually compiled successfully. Suspecting that I may not
have understood the meaning of the term "composite index" I checked pg
322 of The Firebird Book which states "...it will be of benefit to
create a multi-column index(also known as a composite or complex
index)". If there is a better place to ask this question, please let
me know - I did not think this was a 'bug'.