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

  • Home
  • SEARCH
  • 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 8195049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:00:24+00:00 2026-06-07T05:00:24+00:00

In a web based java application , I have a table with this schema

  • 0

In a web based java application, I have a table with this schema

 Column          Datatype

 Userid          char(25) primary key;
 name            char(100)
 address         varchar(120)
 email           char(50) UNIQUE;

with 120000 records. (Cardinality)

Now, I want to fetch the matching names (character by character) stored under column -> name. when I start typing in a search box (through ajax obviously).

e.g. if I write p then all names starting from letter p will be retrieved and would come in the list to populate.

Right now I am not using any indexing
. So how could I use it to make the access/search faster.

The database I am using is MySql 5 and java as frontend.

Any suggestion for using appropriate collection for this purpose or any hashing would help in the database if yes please elaborate.

Though I have got the right track for this StackOverflowers. If I
modify the question and use hashing in place of indexing with all its
definition and usage statistics then how to do that and is it
beneficial?

  • 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-07T05:00:25+00:00Added an answer on June 7, 2026 at 5:00 am

    The simplest way is just:

    ALTER TABLE `your_table` ADD INDEX(`name`);
    

    And also, as names are variable length, use VARCHAR instead. For your key, use INT!

    You can shrink your index to one byte if you search by one character only:

    ALTER TABLE `your_table` ADD INDEX `name`(`name`(1));
    

    Then, for better performance, you can use covering index. It means you need to have all required data indexed properly so it resides in memory (make sure you configured your server properly) and MySQL does not need to read from disk.

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

Sidebar

Related Questions

I have a java based web application. This is the behaviour I am seeing
i have three java based web application app1,app2 and app3 at production. All 3
I have a Java based web-application using Java Server Faces and Facelets. I am
We have a Java EE-based web application running on a Glassfish app server cluster.
Hi I have a page in my java/jsp based web application which shows list
I have a Java Web-Start-based application, which utilizes several native ".exe" utilities. All jars
We have a Web Java based application running on JBoss with allowed maximum heap
I am using Orion server for my Java-based web application. I have a run
I have a Spring framework based Java web application, which has been built in
I have a java web application based on Spring MVC. The task is to

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.