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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:54:52+00:00 2026-05-24T15:54:52+00:00

I am working for a startup that is building a iphone app. And i

  • 0

I am working for a startup that is building a iphone app. And i would like to ask a few questions to improve an algorithm we use for string matching.

We have a database that has a huge list of phone numbers along with the name of the user who owns the phone number. Lets say that the database looks like this

name phonenum


hari 1234

abc 3873

….

This database has large number of rows (around 1 million). When the user opens the app, the app gets the list of phone numbers from the person’s phone contacts and matches it with the database. We return all the phone numbers that are present in the database. Right now, what we do is very very inefficient. We send the phone numbers from phone contacts in sets of 20. And we match it with the database. This will lead to a complexity of num of phone contacts * O(n).

I thought of some improvements like having the database rows sorted by phone numbers so that we can do binary search. In addition to that, we can have a hash table containing some 10,000 phone numbers in the cache memory and we can search against this cache memory initially. Only if there is a miss, we will access the database and search the database with complexity of O(log n) using binary search.

Also, there is the issue of sending phone numbers for matching. do i send them as such or send them as a hashed value ? will that matter in terms of improving performance?

Is there any other way of doing this thing?

I explained the whole scenario so that you can have a better understanding of my need

thanks

  • 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-24T15:54:53+00:00Added an answer on May 24, 2026 at 3:54 pm

    If you already have an SQL Server database, let it take care of that. Create an index on the phone number column (if you don’t have it already). Send all the numbers in the contact list in one go (no need to split them by 20) and match them against the database. The SQL server probably uses much better indexing than anything you could come up with, so it’s going to be pretty fast.

    Alternatively, you can try to insert the numbers into a temporary table and query against that, but I have no idea whether that would be faster.

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

Sidebar

Related Questions

I'm in lean startup mode, working on a simple phone app that will be
I'm working on a location-based app that makes use of the CLLocationManager region monitoring.
I'm working with an app that starts at OS startup. Is there any way
I am working on a .NET app that will also run on iphone via
I am working on a Java application that will use some Hibernate (annotated by
I'm building some Word 2003 macro that have to be put in the %APPDATA%\Microsoft\Word\Startup
I am developing an app that at startup sets up a database cursor to
I am working on an application that loads plugins at startup from a subdirectory,
I am a newbie working in a simple Rails app that translates a document
At the startup I'm working at we are now considering scaling solutions for our

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.