Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 733545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:16:11+00:00 2026-05-14T07:16:11+00:00

We took over a website from another company after a client decided to switch.

  • 0

We took over a website from another company after a client decided to switch.

We have a table that grows by about 25k records a day, and is currently at 15MM records.

The table looks something like:

id (PK, int, not null)
member_id (int, not null)
another_id (int, not null)
date (datetime, not null)

SELECT COUNT(id) FROM tbl can take up to 15 seconds.

A simple inner join on ‘another_id’ takes over 30 seconds.

I can’t imagine why this is taking so long. Any advice?

SQL Server 2005 Express

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:16:11+00:00Added an answer on May 14, 2026 at 7:16 am

    Do note that COUNT(id) will usually result in a full table scan, so it has to read the entire table to get the count. If counting is really a very important thing for you, you might want to consider creating a trigger to store the results of the count in some other table.

    Without the query I can’t say much about the inner join, but my guess would be that you don’t have an index on either id or another_id

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I took over an existing iOS app from a client, that is currently
I recently took over a project that has a pretty dirty database... The table
Recently I encountered a bug in an application I took over from another developer.
I have a zipcode field in a database that I just took over. Previously,
I took over another project and have fixed everything else except this one problem.
I'm having troubles with an asp.net 2.0 application that I took over from other
I have a asp.net-mvc web site that i took over and there is a
i have a project i took over. it is an app that has been
I took over a Visual C++ project in Visual Studio 2005 from a colleague.
I took over a project several months ago that involved polymorphic associations that were

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.