Contains Operator

  • Hello

    I Write a query which use 'Contains' operator in it . when I execute this query in sql server 2005

    the run time is very fast but when I execute in sql server 2008 R2 it took 16 seconds . I rebuild my

    fulltext and alter all indexes in each table but did not work . Can anybody help me?

    This is my query:

    /*****

    SELECT Distinct document.DocNo,document.DocType,Title.Title,Header.WriterName+' '+Header.WriterFamily+' '+Header.Conf+' '+Header.Tanalgan

    AS Padid1,Publisher.PublisherName+' '+Publisher.PublishedPlace+' '+Publisher.PublishedDate

    As T,Rade.MainRange+'،'+Rade.Num+'،'+Rade.KaterNo+'،'+Rade.Date1 As Rade

    --,ROW_NUMBER() OVER(Order By Save1.SaveCode) AS RowNumber

    FROM Document Left Outer JOIN

    Description1 ON document.DocNo = Description1.DocNo Left Outer JOIN

    Padid ON document.DocNo = Padid.DocNO Left Outer JOIN

    Publisher ON document.DocNo = Publisher.DocNo Left Outer JOIN

    rade ON document.DocNo = rade.DocNO Left Outer JOIN

    Subjects ON document.DocNo = Subjects.DocNo Left Outer JOIN

    Title ON document.DocNo = Title.DocNO Left Outer JOIN

    Header ON document.DocNo = Header.DocNo,Save1

    Where [Document].DocNo<>'0'

    And [Document].DocNo=Save1.DocNo

    And [Document].DocType=Save1.DocType

    And document.DocType='Book'

    AND (Save1.DocStatus = 'Shelf')

    And( (CONTAINS(Title.Title , '"abc"')

    OR CONTAINS( Header.WriterName , '"abc"')

    OR CONTAINS( Header.WriterFamily , '"abc"')

    OR CONTAINS(Publisher.PublisherName , '"abc"')

    OR CONTAINS(Publisher.PublishedPlace , '"abc"')

    OR CONTAINS(Publisher.PublishedDate , '"abc"')

    OR CONTAINS(Description1.ISBN , '"abc"')

    OR CONTAINS(Title.Farvast , '"abc"')

    OR CONTAINS(Header.Tanalgan , '"abc"')

    )

    )

    AND Rade.Type='LC'

    ****/

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply