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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:04:17+00:00 2026-06-10T15:04:17+00:00

Today I just read some comments and I made some experiment. I imagined a

  • 0

Today I just read some comments and I made some experiment. I imagined a system which storing some coordinates.

Here is the situation:

I have two tables, the first is:

CREATE TABLE Points
(
ID int IDENTITY(1,1) PRIMARY KEY,
X int,
Y int,
Name varchar(20),
Created datetime
)

It is just storing coordinates (1 million rows). The second one is a helper table storing some let’s say often used points for a select (around 1100 rows)

CREATE TABLE PointSearchHelper
(
X int,
Y int
)

So far so fine.

I would like to make an easy select:

SELECT p.* FROM Points p 
INNER JOIN PointSearchHelper h
ON p.X = h.X AND p.Y = h.Y

I run the script, it gets the 1100 rows in around 280 ms on average.

When I check the execution plan I see, that the SQL Server 2008 R2 recommends an index (who would have thought? 😉 ) :

CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,>]
ON [dbo].[Points] ([X], [Y])
INCLUDE ([ID], [Name], [Created])

This one is a full index on the table, contains each column. It’s size is “huge” comparing, that I’m storing the data now two times!

So the query no is much faster! It is around 75 ms(!) Very great improvement BUT I need almost double space for this improvement.

My question is simple: Is there any way to tell the SQL Server on the columns how to store the values or any other trick to save yourself from a double storage?

UPDATE:

With other words: is there any trick to avoid the “full index” with the same performance?

  • 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-10T15:04:18+00:00Added an answer on June 10, 2026 at 3:04 pm

    Change your PointSearchHelper table to just use the index rather than the x, y coordinates:

    create table PointSearchHelper . . .
        points_id int not null primary key
    

    When you do the join, do it on points_id instead. This should reduce space and increase performance.

    PS. I’m having the weirdest problem. Adding an open paren to the code is causing an error in loading the anwer.

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

Sidebar

Related Questions

I am tryint to read an image with OpenCV 2.1 (started just today), C++
I noticed something odd today. I have an application that writes/read data to a
I'm thinking about security problems, made some questions, read some articles..... it's too difficult
Yesterday i installed C# 3.5 and today when read topic here of Accessing Google
today I just opened my 1,5 month old project and wanted to add a
Just today I've started using Drupal for a site I'm designing/developing. For my own
Just today I noticed on our Wordpress blog that the Facebook iframe is showing
I've just today learned of asp.net mvc, and I'm wondering what is needed from
So today I just came across the 'live()' function that binds any future and
I am a beginner in node.js (infact started just today). One of the basic

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.