Search code examples
sql-serversql-server-2008selectexecution

Simple selects takes so much time to execute


I have a complex select with JOIN and UNION and it takes long time so I decided to test it in a simple select but this select still takes time to execute. I have saved the execution plan here

The code is only

SELECT pchrgqty,pchrgup,pcchrgamt  FROM 
hdocord
WHERE acctno = '2014-000136557'

But it takes 1 minute and 11 seconds to execute

How to make this faster? Why is it is very slow?


Solution

  • You can try to add the lacking index just running this SQL statement :

    CREATE NONCLUSTERED INDEX ix_hdocord_acctno ON hdocord
    (
        acctno ASC
    )
    ON [PRIMARY]
    

    It will fail if they haven't given you enough permissions.