Taking a lot of time to excute

  • Dear All,

    I have to 2 DataBase DBMain and DBAudit,

    All the Tables in the DBMain will be in the DBAudit allows

    we are inserting one record in the DBAudit Table when any operation is done on the main table record (DBMain) such as delete,update and insert.

    DBMain -TableA

    DBAudit-[$TableA](this table contains all the colums of Table A and 3 more additional columns such as [$sessionid]$,[$Userid],[$Datetime])

    No the Record count in the DBAudit table has crossed more than 5 lakhs. when the execute

    select * from DBAudit.dbo.[$TableA]

    it is taking more than 1 minutes to execute

    is there any opition so the we can reduce the execution time.

    please help me to solve this issue.

  • Hi,

    Can I ask why would you want to return every one of the 500,000+ changes so far to a database table? Would you not just want to see the latest changes?

    Cutting down the number of rows required would certainly speed up the request. :hehe:



    Ade

    A Freudian Slip is when you say one thing and mean your mother.
    For detail-enriched answers, ask detail-enriched questions...[/url]

  • Can you post the schema of the table please?

    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

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

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