Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Have large table (Sybase) rows = 6276225. I'm pulling call status and my query is very slow.

In effect what I’m trying to do is pull data for any event after my variable. While querying for just one acct, the query takes around 15 sec, anything larger and my query runs forever.

How can I speed up my query?

@RSP varchar (2)
@RSP = 'WN'


from table a

where  a.time_of_contact >=
                      FROM table b
                      WHERE  a.account_number = b.account_number
                             and a.ov_phone_number = b.ov_phone_number
                             and a.time_of_contact >= b.time_of_contact
                             and b.contact_list_name ='Prime_list'
                             and b.response_status = @RSP)
share|improve this question
A non-correlated query could be faster but 15 seconds is still too much for one account. Please post the table schema and the explain plan. – Jakub Kania Apr 27 '13 at 10:03
@jason: 1: post the schema for table a and b, including indexes definitions. 2: How long will it take to run JUST the subquery. 3: Post the exection plans for both the full query and the subquery. – MTIhai Apr 30 '13 at 8:24
@jason - Sybase is a company, not a database. Which Sybase product are you using? – Michael Gardner May 1 '13 at 11:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.