Slow query, Can it be pepped up?

Results 1 to 3 of 3

Thread: Slow query, Can it be pepped up?

  1. #1
    Kyoko Guest

    Default Slow query, Can it be pepped up?

    This query runs a little slow, and for one query (the numbers I&#039ve inserted here) it frequently times out. I wonder if anyone might be able to notice if there is something that might be changed so it ran better. <BR><BR>SELECT DISTINCT <BR> Keyword.Description AS level1, Keyword.Code AS code1, <BR> Keyword_1.Description AS level2, Keyword_1.Code AS code2, <BR> Keyword_2.Description AS level3, Keyword_2.Code AS code3, <BR> Keyword_3.Description AS level4, Keyword_3.Code AS code4, <BR> Keyword_4.Description AS level5, <BR> Keyword_4.Code AS code5<BR>FROM (((Keyword AS Keyword_1 INNER JOIN<BR> (Keyword INNER JOIN<BR> Product ON Keyword.Code = Product.Level1Key) ON <BR> Keyword_1.Code = Product.Level2Key) INNER JOIN<BR> Keyword AS Keyword_2 ON <BR> Product.Level3Key = Keyword_2.Code) INNER JOIN<BR> Keyword AS Keyword_3 ON <BR> Product.Level4Key = Keyword_3.Code) INNER JOIN<BR> Keyword AS Keyword_4 ON <BR> Product.Level5Key = Keyword_4.Code<BR>WHERE (((Keyword.Code) = &#039 66&#039) AND ((Keyword_1.Code) = &#039 1335&#039) <BR> AND ((Keyword_2.Code) = &#039 2512&#039) AND ((Keyword_3.Code) <BR> = &#039 4470&#039))

  2. #2
    MG Guest

    Default RE: Slow query, Can it be pepped up?

    -Make it a store procedure.<BR>-Be sure that you have indexes on all of your join fields and the Code field.

  3. #3
    Kyoko Guest

    Default Stored Procedure with Request.Querystring?

    I have been looking into stored procedures, and before I embark I need to confirm that stored procedures will work with queries that include request.querystring("fieldname")&#039<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts