Subject | Question about Firebird indexes |
---|---|
Author | Zd |
Post date | 2008-07-01T07:50:40Z |
Dear Group,
I know that you can put an index on a single column and on multiple columns at the same time. But you can also put a separate index on each column - my question is: what's the difference?
Eg:
CREATE INDEX IDX_DEFAULTDOCUMENTS ON DEFAULTDOCUMENTS(DOCUMENTTYPEID,DOCUMENTTYPE);
or
CREATE INDEX IDX_DEFAULTDOCUMENTS1 ON DEFAULTDOCUMENTS(DOCUMENTTYPEID);
CREATE INDEX IDX_DEFAULTDOCUMENTS2 ON DEFAULTDOCUMENTS(DOCUMENTTYPE);
I simply want to index two columns of my table, so when I search SEPARATELY for either DocumentTypeID or DocumentType, I want the SELECT to be as fast as possible. Which is the road to take?
Thanks for the info:
Zd
[Non-text portions of this message have been removed]
I know that you can put an index on a single column and on multiple columns at the same time. But you can also put a separate index on each column - my question is: what's the difference?
Eg:
CREATE INDEX IDX_DEFAULTDOCUMENTS ON DEFAULTDOCUMENTS(DOCUMENTTYPEID,DOCUMENTTYPE);
or
CREATE INDEX IDX_DEFAULTDOCUMENTS1 ON DEFAULTDOCUMENTS(DOCUMENTTYPEID);
CREATE INDEX IDX_DEFAULTDOCUMENTS2 ON DEFAULTDOCUMENTS(DOCUMENTTYPE);
I simply want to index two columns of my table, so when I search SEPARATELY for either DocumentTypeID or DocumentType, I want the SELECT to be as fast as possible. Which is the road to take?
Thanks for the info:
Zd
[Non-text portions of this message have been removed]