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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:44:09+00:00 2026-05-24T03:44:09+00:00

If I have a table with three decimal columns x_coordinate , y_coordinate and proximity

  • 0

If I have a table with three decimal columns x_coordinate, y_coordinate and proximity and a where clause that looks like either this:

@x_test between (x_coordinate - proximity) and (x_coordinate + proximity)
and
@y_test between (y_coordinate - proximity) and (y_coordinate + proximity)

or this:

power (@x_test - x_coordinate, 2) < power (proximity, 2)
and
power (@y_test - y_coordinate, 2) < power (proximity, 2)

Short of storing values in the table for x_min, x_max, y_min and y_max (I don’t have the authority to change to database layout), can an index be constructed that will speed this up? My understanding of how indices work makes me think that due to the fact that the value in the table I’m comparing against is computed that there are not.

This logic is currently done by getting all of the results from a particular date range from the database (I left that portion out of the example queries), and filtering out by proximity in the client program. This was apparently done in the past for speed reasons, but with database technology nowadays I was going to perform some speed tests to see if that was still true.

  • 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-24T03:44:10+00:00Added an answer on May 24, 2026 at 3:44 am

    You can add a computed column and create an index on it; there are some restrictions, check here. If you are not allowed to change table design, you can always create a VIEW with computed column and index it. Depends on SQLServer edition, this index might be used (Enterprise Edition) while querying underlying table implicitly.

    • 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 looks like this: CREATE TABLE [dbo].[StudentTime] ([StudentTimeID] [int] NOT
I have a table that has three different date columns, so I set each
I have a table with three columns: user varchar, status varchar , rep int
I have a table with three filled columns named Name, City and Occupation. I
I'm using SQL Server 2008 and I have a table with three columns: Length
I have a logging table which has three columns. One column is a unique
I have a (simplified) table consisting of three columns: id INT PRIMARY KEY NOT
I have a table in SQL Server 2005 which has three columns: id (int),
I have a table(offer) with three columns, id, product_id and price. offer ----- id
I have tried adding a foreign key like this... ALTER TABLE OrderLineItem ADD CONSTRAINT

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.