Slow Query Processing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • guptamkomal
    New Member
    • May 2007
    • 6

    Slow Query Processing

    SELECT DISTINCT "MCOMP"."MCMP_N AME", "MLOC"."MLOC_NA ME", "MDEP"."MDEP_NA ME", "TDAY"."TDAY_EM PCDE", "MEMPOFF"."MEMP _NAME", "TDAY"."TDAY_SF TREPO", "TDAY"."TDAY_DA TE", "TDAY"."TDAY_EX HR", "TDAY"."TDAY_SF TASSG", "MEMPOFF"."MEMP _CODE"
    FROM ((("krishna"."d bo"."TDAY" "TDAY" INNER JOIN "krishna"."dbo" ."MEMPOFF" "MEMPOFF" ON "TDAY"."TDAY_EM PCDE"="MEMPOFF" ."MEMP_CODE" ) INNER JOIN "krishna"."dbo" ."MCOMP" "MCOMP" ON "MEMPOFF"."MEMP _CMPCD"="MCOMP" ."MCMP_CODE" ) INNER JOIN "krishna"."dbo" ."MDEP" "MDEP" ON "MEMPOFF"."MEMP _DEPCD"="MDEP". "MDEP_CODE" ) INNER JOIN "krishna"."dbo" ."MLOC" "MLOC" ON "MEMPOFF"."MEMP _LOCCD"="MLOC". "MLOC_CODE"
    ORDER BY "MCOMP"."MCMP_N AME", "MLOC"."MLOC_NA ME", "MDEP"."MDEP_NA ME", "MEMPOFF"."MEMP _NAME"

    I am using Crystal Report XI and SQL Server 2000.
    This is my SQL Query,Generated by the Database -> Show SQL Query.
    If I am running this Query in SQL Query Analyzer than it takes above 15 min to show the output, and there are 1039131 records from this output.
    Is there is any way to reduse the time it takes to show the output.

    Thanks

    Regards,
    Komal.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Please do not post duplicate threads , as u have already posted the same question a day before.

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      Since it contails a lot of records, try creating indexes on frequently used columns.

      Comment

      Working...