Subject | Re: Can someone explain to me what's the best way to do this? |
---|---|
Author | andrew_s_vaz |
Post date | 2004-12-01T01:25:47Z |
> > The answer, for your application, may be to find a texttokenization (or an UDF) and some triggers. However, when only
> > indexing package for Firebird - there are some, though I
> > don't have a pointer at the moment.
> >
>
> The most simple solution is to use a stored procedure for
searching for "names CONTAINING 'i'" this wont yield much performance
gain. How fast such an indexed search can be, depends mostly on the
data distribution, which isnt perfect when indexing a table full of
names. A simple scenario for a fulltext index contains a table with a
lowercased word, and a foreign key to the row in which the word
occurs. When there are many repeating words, a mapping table for n:m
relation between token-table and data-table should be included.
Triggers update these tables when data is inserted, modified and
deleted. When searching for full words/tokens, the token-table can be
queried via an index, which can be quite fast even when scanning
several thousand records for the specified word:
>Names.ID WHERE Index_Names.Name='albert';
> SELECT * FROM Index_Names INNER JOIN Names ON Index_Names.FID =
>ram and firebirds page cache, so that there wont be too many disk I/Os
> This would yield for example these rows from Names:
>
> "Albert"
> "Steven Albert"
> "Sven Albert Smith"
>
> In your case, maybe the most simple option is to enlarge the server
necessary to lookup the record you are searching for. Every disk I/O
costs at least the time to position the head to the sector on the
drive, which is much slower than simply reading data from RAM.
>I'll surely be considering it, thanks a lot.
> Regards, Alex
Andrew