[sylpheed-jp:10581] Re: sylph-searchインデックス追 加

Tatsuo Ishii <[email protected]>
Newsgroups gmane.mail.sylpheed.general.japanese
Message-ID <[email protected]>
> > Sylph-searcherですが,現状日付のフィールドにインデックスが付いていない
> > のですが,ここにインデックスを付けると,検索条件で日付が指定されている
> > 場合にかなり早くなります.お試しあれ.
> 
> どうせだから from/to/subjectにもつけましょう。
> (自分はそうしてます。93万通ほど溜め込んでるので...)
> 
> CREATE INDEX msginfo_hdr_from_index ON msginfo (hdr_from);
> CREATE INDEX msginfo_hdr_to_index ON msginfo (hdr_to);
> CREATE INDEX msginfo_hdr_subject_index ON msginfo (hdr_subject);

残念ながらこれは効果がないと思います.なぜなら,sylph-searcherはこれら
の列に対する検索をLIKEの中間一致(いわゆるワイルドカード検索)と呼ばれる
方法で検索しているからです.PostgreSQLのBtreeインデックスは,こういう
検索パターンには使用されません.

私はこの問題を解決するために,これらの列に対しても全文検索を併用して高
速化したバージョンを個人的に使っています(PostgreSQL 8.3限定ですが).技
術的内容に興味のある方はこちらをどうぞ.

http://postgresql.at.webry.info/200803/article_1.html

> (自分はそうしてます。93万通ほど溜め込んでるので...)

すごいですね.私も結構多い方だと思ったのですが,まだ37万通程です:-)
--
Tatsuo Ishii
SRA OSS, Inc. Japan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.