Oracle 11g Text を使用していますが、
AuthorTable : (著者の詳細のテーブル) AuthorId、AuthorName、AuthorDOB
ArticleTable : (記事コンテンツのテーブル) ArticleId、WrittenDate、PublishDate、ARTICLE_TXT (CLOB)
LocationTable : (場所のテーブル) LocationId、LocationState、LocationCity
ArticleAuthorAssocTable : (Article-Author Association のテーブル) AuthorId、ArticleId
LocAuthorAssocTable : (Author-Location Association のテーブル) AuthorId、LocationId、LocationStartDate、LocationEndDate
私のクエリは、ARTICLE_TXT の入力検索語と、PublishDate / WrittenDate / AuthorDOB / LocationCity / LocationStartDate の範囲の他のクエリを検索する必要があります。
混合クエリを実行する必要があるため、ArticleTable で複合ドメイン インデックス CDI の作成を開始しました。
CREATE INDEX ARTICLE_TXT_CDI_IDX ON ArticleTable(ARTICLE_TXT)
INDEXTYPE IS ctxsys.CONTEXT
FILTER BY WrittenDate, PublishDate
およびクエリ
SELECT
/*+ domain_index_sort domain_index_filter(ARTICLE_TXT_CDI_IDX) */ article.ARTICLE_TXT,
author.AuthorName , article.WrittenDate, article.PublishDate, LocationTable.LocationCity ,location.LocationStartDate, location.LocationEndDate
FROM
ArticleTable article
INNER JOIN
ArticleAuthorAssocTable articleAuthorAssoc ON article.articleId = articleAuthorAssoc .articleId
INNER JOIN
AuthorTable author ON author.authorId= articleAuthorAssoc.authorId
INNER JOIN
LocAuthorAssocTable locAuthorAssoc req ON author.authorId = locAuthorAssoc.authorId
INNER JOIN
LocationTable location ON location .authorId = locAuthorAssoc.authorId
WHERE
CONTAINS(article.ARTICLE_TXT, 'Something') >0
AND author.AuthorDOB BETWEEN TO_DATE('01/01/2001','MM/DD/YYYY')
AND TO_DATE('12/31/2012','MM/DD/YYYY')
AND location.LocationId IN (1,2)
今私の質問は次のとおりです。
- 異なるテーブルの列に FILTER BY を使用して複合ドメイン インデックスを作成することは可能ですか?
- 上記のクエリを改善する他の方法はありますか?
私の調査によると、いくつかのオプションはマテリアライズドビュー、関数ベースのインデックス、USER_DATASTORE を使用しています。
残念ながら、それらの使用方法はまだわかりません...あなたの知識を手伝ってください。
ありがとう