slow query due to index fragmentation?

  • Hi, actually there's an issue with a query that is generated by Cognos.

    I traced the report queries with SQL Server Profiler.

    One query takes about 11 minutes and has 30 filters.

    This query takes about 10 seconds without two certain filters. The attributes of these filters have indexes. So I rebuilt the indexes, but it didn't help.

    Thanks in advance for your response,

    Andre

  • Please post query, table definitions, index definitions and execution plan as per http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Here's the part of the query which slows the execution down:

    ...

    , T_02_RH_REGIONAL_HIERARCHY T14

    , T_14_PL_PLATFORM coguda62

    where (T_TD_DATE_HIERARCHIES_DAILY13.TD_KEY = 11

    or T_TD_DATE_HIERARCHIES_DAILY13.TD_KEY = 4)

    and (1 = 0 or T14.CF_CODE = '079')

    /* Following 2 statements slow the query down */

    and T14.RH_FRC_COUNTRY_CODE_02 = '079'

    and T14.RH_DISTRICT_CODE_02 = 'DCM'

    /* the 2 statements above slow the query down */

    and (1 = 0 or T_03_CE_CUSTOMER_ENTITIES_PL.CF_CODE = '079')

    You find the whole query, table definition, index definitions and the execution plans in the attachment.

    Please let me know, if you need more informations!

Viewing 3 posts - 1 through 2 (of 2 total)

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