Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Posts
    12

    Question Unanswered: INDEXED VIEW Performance Problem...

    I have an Indexed View with followed syntax:

    CREATE VIEW VW_Emplacamentos
    WITH SCHEMABINDING
    AS
    SELECT A.CD_Linha -- This is the unique clustered field
    A.DT_Emplacamento,
    A.NR_CNPJ,
    A.CD_Municipio,
    A.VL_Potencia,
    A.VL_CapacidadeCarga,
    A.NR_QtdPax,
    A.NR_AnoFabricacao,
    A.NR_Chassi,
    A.SG_UF,
    A.CD_MarcaModelo,
    A.CD_Procedencia,
    A.CD_Combustivel,
    B.NM_Municipio,
    C.NM_Combustivel,
    D.NM_MarcaModelo,
    D.CD_Segmento,
    D.CD_Fabricante,
    E.NM_Segmento,
    F.NM_SubSegmento,
    G.NM_Fabricante

    FROM dbo.TB_Emplacamentos AS A
    INNER JOIN dbo.TB_Municipio AS B ON A.CD_Municipio = B.CD_Municipio
    INNER JOIN dbo.TB_Combustivel AS C ON A.CD_Combustivel = C.CD_Combustivel
    INNER JOIN dbo.TB_ModeloVeiculo AS D ON A.CD_MarcaModelo = D.CD_MarcaModelo
    INNER JOIN dbo.TB_SegmentoVeiculo AS E ON D.CD_Segmento = E.CD_Segmento
    INNER JOIN dbo.TB_SubSegmentoVeiculo AS F ON D.CD_SubSegmento = F.CD_SubSegmento
    INNER JOIN dbo.TB_Fabricante AS G ON D.CD_Fabricante = G.CD_Fabricante


    The following query is not getting perfomance. I don't what's going on.

    SELECT COUNT(*)
    FROM VW_Emplacamentos
    WHERE DT_Emplacamento BETWEEN '20040301' AND '20040316'
    AND NM_Fabricante = 'VW'

    I've created an compost index on the following sequece
    DT_Emplacamento,NM_Fabricante,NM_Segmento

    But it still slow.

    I really apreciate comments.
    Rafael Hidd Germenink
    DBA - Database Administrator
    ICS - Impacta Certified Specialist

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Well that's a lot of joins...they all indexed?

    What does your show plan say?

    What' sthe view suppose to be for?

    What does the count tell you?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

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