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 8506605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:38:10+00:00 2026-06-11T02:38:10+00:00

I have roughly 365 Million Rows inside my tables and each day we add

  • 0

I have roughly 365 Million Rows inside my tables and each day we add an additional Million rows after the data is a year old it gets moved to a different table that archives our data.

I have a PK Clustered index on DataCollectionID.

I have one other index: a Unique Nonclusted index on AssetID, DataPointID, and DatapointDate

I need to run multiple select queries against the table pretty quickly… here is my select Query:

SELECT [DataPointID]
  ,[SourceTag]
  ,[DatapointDate]
  ,[DataPointValue]
FROM DataCollection
Where 
  DatapointDate >= '2012-09-07' AND 
  DatapointDate < '2012-09-08' AND
  DataPointID = 1100
ORDER BY DatapointDate

This query should return 8,640 rows which it does but it takes 00:00:08 (8 seconds) to execute. Even if I said give me top 10 it still takes 8 seconds. Can someone please help me speed up this process?

  • 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-06-11T02:38:12+00:00Added an answer on June 11, 2026 at 2:38 am

    I think a more effective index to help this query would be on DataPointID, DataPointDate, in that order. This will allow the optimizer to quickly narrow down the field with an equality operator on the first index column, then find the date range within that set.

    There are some good examples of indexes and similar queries here:

    http://sqlserverpedia.com/wiki/Index_Selectivity_and_Column_Order

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

Sidebar

Related Questions

I have a list of roughly 3000 rows. Each row has a different end
In an Excel sheet, I have roughly 30 rows x 100 columns of data.
So, i have a table with roughly 1.5 million rows in it, looking somewhat
I have roughly 12 computers that each have the same script on them. This
On my home page i have roughly 10 grids that sit inside ajax tabs
I have some tables roughly like so: Client: id name Employee id name Email
I have 12 databases totaling roughly 1.0TB, each on a different physical server running
I have a system with roughly a 100 million documents, and I'd like to
I have some strings that are roughly 10K characters each. There is plenty of
We have a (currently InnoDB) table which contains roughly 500,000 rows. This represents a

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.