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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:02:31+00:00 2026-05-25T10:02:31+00:00

I have a Location table with a street address column. My app provides a

  • 0

I have a Location table with a street address column. My app provides a search mechanism that queries locations with this column and I am trying to speed up the queries. The db has a little over 2 million records and I just thought I’d put out this question to see what people have done. I’m sure I’m not the first. My question is basically this: given a primary key, address, city, state, zip columns, how should this table be indexed so that queries like the following don’t take 10 seconds:

`select * from location where loc_address_s like '%blvd%'`
`select * from location where loc_address_s like 'oak' AND loc_city like 'salem'`

etc…

  • 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-25T10:02:32+00:00Added an answer on May 25, 2026 at 10:02 am

    Your best bet, if it’s at all possible, is to break the address down into its components. This is how the U.S. post office stores addresses as well as many (most?) large address handling companies and agencies. Database design best practices usually include not having a column hold more than one piece of data for a row. Right now you’re storing a street number, street direction (N for “North Main Street” for example), street name, street type, etc.

    Once you have everything broken out properly you can index individual columns if you need to do that.

    I’m sure that there’s a standard out there (a quick search of the ansi.org website didn’t give me anything though). Storing addresses is a pretty common thing to have to do.

    Also, you can find many address clean-up services and software to break up addresses into these columns if you don’t want to go through that effort entirely on your own.

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

Sidebar

Related Questions

I have 3 tables event, location, event_location. Event can have multiple locations. Location table
I have a database table which link locations together; a location can be in
I have a mysql table with three columns: username, location, timestamp. This is basically
Table = location Fields = address, street, suburb address fields are initially empty, street
I have a table for each location type (City, Street, Country, etc). Now i
I have a table Location that has a foreign key relationship to a Site.
I have table called location with a field area. This field can contain various
hey, following problem here: i have table with persons that have one location, if
i have this table: Location date temp 1 12-12-2009 19 1 14-12-2009 21 1
Given this: create table Location( LocationId int identity(1,1) not null primary key, Address nvarchar(max)

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.