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

  • Home
  • SEARCH
  • 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 90775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:55:33+00:00 2026-05-10T22:55:33+00:00

I have a table that has 8 million records, with many fields, including lat/long

  • 0

I have a table that has 8 million records, with many fields, including lat/long values, and it has an index over the Lat/Long fields.

I’m making a query to find the records that fall within a square around a point (to later refine into a circle), which is kind of:

SELECT Lat,Long FROM Data WHERE (Lat BETWEEN 1 AND 2) AND (Long BETWEEN 1 AND 2).

In my dev machine, this uses the index, and returns in about 50ms (the first time I do a query for a specific point).
In my production server, it also uses the index, but it takes about 2-4 seconds to return for the first query, 10ms for the following ones.

In my dev machine, SQL Server is taking 500Mb of memory, in my server, about 130Mb.

To me, the obvious conclusion is that in my machine the index is loaded into memory, and in the production sever it’s not…

Is my assumption correct? What can I do to fix it?

This is SQL Express 2005 (the free version) on W2k3 in both machines. The one difference I can think of is that my machine is 32bit, and the server is 64, but I don’t think how this could affect the loading of the index in memory.

Also, the server is not running short in memory. It has 2Gb physical mem, and a commit charge of around 500Mb, so there’s plenty to spare.

Any ideas will be greatly appreciated! Thanks!

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T22:55:34+00:00Added an answer on May 10, 2026 at 10:55 pm

    When I encounter this situation there are usually two things I try, in the following order:

    1 – update statistics on that table:

    UPDATE STATISTICS Data

    2 – Rebuild the index: (right-click on the index in SQL Server Management Studio and select Rebuild)

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

Sidebar

Related Questions

I have a table that has about 1/2 million records in it. Each month
I have an innodb table that contains 70 million records and already has several
I have a table in MySQL that has 3 fields and I want to
I have table named as contacts which has nearly 1.2 million records we use
I have mysql DB in which a single table has 7 million records, the
I have a InnoDB table that has about 17 normalized columns with ~6 million
I have a table masterurls it has morethan 1 million records. I want to
I have a table that has redundant data and I'm trying to identify all
I have a table that has an insert trigger on it. If I insert
I have a table that has a processed_timestamp column -- if a record has

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.