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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:41:58+00:00 2026-06-08T07:41:58+00:00

Hi I have database table struture Like following table – ItemLocation ItemId varchar(10) ItemGeo

  • 0

Hi I have database table struture Like following table – ItemLocation

ItemId varchar(10)          ItemGeo (geography)
123n13                      POINT (-79.660470500000017 43.5482682)
n4f923                      POINT (-79.7511776 43.6575816)

and more rows…………………..

And i am using a simple insert to insert the data now, But actually i want to insert the rows by location so that Items which are close will stay together in the database so If a try to insert a new item ‘q3eqwe2’ which is more close to 123n13 so it will go next to 123n13 and replace n4f923 index and all the bottom rows will move to index + 1. Is this feasible ?

ItemId varchar(10)          ItemGeo (geography)
    123n13                      POINT (-79.660470500000017 43.5482682)
    q3eqwe2                     POINT (-79.66039911221 43.5479121)
    n4f923                      POINT (-79.7511776 43.6575816)

If it is feasible i dont want to go through all the rows checking ItemGeo column to find the perfect index for new row, so can I add new column which will Index on the basis of the Item location and i can easily find the closest location match to insert?
Hope it make sense 🙂

  • 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-08T07:41:59+00:00Added an answer on June 8, 2026 at 7:41 am

    I’m not sure it does make sense. Effectively with a geography type, you’re asking for a two dimensional index mapped onto a globe. If A is close to B, and B is close to C, A could be close to C, or far from C, and then we’re into the travelling salesman problem. Where does your index start and end?

    You can create a spatial index on your geography type. I think that’s the best option.

    The root of the question is why do you think you need to?

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

Sidebar

Related Questions

I have a mysql database with a table structure like below : Table Name
I have mysql database structure like below: CREATE TABLE test ( id int(11) NOT
I have no control over database schema and have the following (simplified) table structure:
I have the following database structure: Event table Id - Guid (PK) Name -
Using the following database table structure: Order Table: OrderId OrderName OrderItem Table: OrderId ItemId
I have an XML structure like the following: <tables> <table name=tableName1> <row ID=34 col1=data
I have a MySQL database with the following table structure: TransactionType : Transaction_Amount, Transaction_ID,
I have the following database structure: Sites table id | name | other_fields Backups
I have a database with the following structure: CREATE TABLE entity ( id SERIAL,
Hi all i have the following table called student in SQLite database. this is

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.