Hi!
On Sep 28, Hagen H?pfner wrote:
> Looking for information about the "structur" of FT-indexes I found the
> following page:
> http://dev.mysql.com/tech-resources/articles/full-text-revealed.html
>
> The outhor pointed out, that these information may become obsolete in
> newer versions. Is it correct, that MySQL 5 also has a simple sorted
> list of
>
> {
> Word -- VARCHAR. a word within the text.
> Count -- LONG. how many times word occurs in text.
> }
> {
> Weight -- FLOAT. Our evaluation of the word's importance.
> Rowid -- a pointer to the row in the data file.
> }
>
> ? What is the sorting criteria?
Not exactly. In 4.0 it was a simple btree with a key structure
word VARCHAR(255), weight FLOAT, rowid
where rowid is automatically the last part of any myisam index, not
something fulltext specific.
In 4.1 it's (what I call a) two-level btree. That is there's a btree or
keys {word, count}, and every such a key contains a pointer to a root
of the btree of the structure {weight, rowid}.
Well, it was a simplification. In fact in 4.1 it's a mix of both - some
nodes of the btree contain word/weight/rowid while others contain
word/count (format is chosen automatically, depending on what takes less
space).
In 5.0 the index structure was not changed.
The index is sorted by {word, rowid}, secondary btree is sorted by
rowid.
Regards,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Senior Software Developer
/_/ /_/\_, /___/\___\_\___/ Kerpen, Germany
<___/ www.mysql.com