SQL Server Performance

this query is taking long time for execution and what should i do ?[production server ]

Discussion in 'ALL SQL SERVER QUESTIONS' started by naga.rohitkumar, Nov 22, 2012.

  1. naga.rohitkumar New Member

    HI all

    SELECT Rtrim(CUST_ACID),rtrim(pmt_id),rtrim(AC_NAME),rtrim(txn_amt),rtrim(pmt_rmks) from payawdb.dbo.pmts,acmt where payawdb.dbo.pmts.cust_acid=acmt.acid and bill_ref_info in
    1.this query is taking long time for execution and what should i do ?[production server ]
    2. it actually takes form one table to another from two databases
    3. can i check the indexes of these tables and if i rebuild will it increase performance ? or whether it will effect on production ??
    4. can we rebuild indexes of the table i these database

    Thanks & Regards
  2. FrankKalis Moderator

    Well, you're providing not enough information for us to suggest anything sensible.
    What exactly does "taking long time" mean? 1 second? 10 seconds, 10 hours?
    Have you looked at execution plans? What do the underlying table structures and indexes look like? How many rows do you expect to be returned out of how many rows overall?

    I think you should have a look at those first, before jumping to conclusions and rebuild the indexes straight away.
  3. naga.rohitkumar New Member

    thanks for the reply and

    details are as follows .

    1. some times when application team try's to execute a simple query ' select count(*) from acmt --------
    ------it a view takes 20 sec to 12 mins and more !!!
    2. yes i have saw the execution plan in it suggests table which it uses going for full table scan and first table has 117 mb size and second table has 600 mb size and both tables has indexes correctly (nonclustered )
    3. and it [view ] has 298314 rows

    4.i cannot rebuild the indexes without approval and if we rebuild will it effect the performance of the production server ,every time this sort of issue arises application team troubling me
    a lot they just want the output very quick

    5.as dba iam trying to do every thing which i know little bit what should i do to solve this ivl be very thankful if i got permanent solution

    Attached Files:

  4. Samane New Member

    I recommand to reduce time of process, optimize your queries by declare more conditions in "where" or "having". these conditions will help you to create spacial scope in your table, so your query return a small table in at least time, then you can process on your result.

Share This Page