>From: D. Richard Hipp [mailto:[EMAIL PROTECTED]
>
-- snip --
>simplifies to O(logN) which is clearly less than O(N).
>In that case, it pays to use the index.
Which is my case I believe, thanks. It's been years (OMG, 16!) since I
had an algorithms class. Is that log base 2, or does it matter?
Note the index in the example had two fields:
CREATE INDEX Articles_Index ON Articles (MessageID, DomainID);
The messageid is almost unique, very rarely (every few years?) would it
be duplicated. The domainid by itself will have many duplicate records,
it is the name of the server that originated the article. Together they
are unique.
By the way, as a brute force experiment I tried an index with only one
field of:
CREATE INDEX Articles_Index ON Articles (MessageID);
And, keeping N large, got a 30% speed improvement. I wonder why? Does
this indicate one could trade some file size (DomainID is a key into
another small table holding the domain string) for a speed improvement
by concatenating the two strings and having only one field?
Also back to one of my original questions: Can the table be kept in one
file and the index be kept in another? The idea would be to localize
the index and suspects it currently is spread throughout the database.
TIA again.