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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:37:45+00:00 2026-05-19T17:37:45+00:00

I added the jquery autocomplete plugin to my places textfield to help users better

  • 0

I added the jquery autocomplete plugin to my places textfield to help users better select a location. What I didn’t realize before building is that the query would be very slow.

select * from `geoplanet_places` where name LIKE "%San Diego%" AND (place_type = "County" OR place_type = "Town")

The query above took 1.18 seconds. Then I tried adding indexes for name and place_type but that only slowed it down (1.93s).

Is there a way to optimize this query or is there another technique to speed up the query.

This geoplanet_places table has 437,715 rows (mysql)

CREATE TABLE `geoplanet_places` (
  `id` int(11) NOT NULL auto_increment,
  `woeid` bigint(20) default NULL,
  `parent_woeid` bigint(20) default NULL,
  `country_code` varchar(255) collate utf8_unicode_ci default NULL,
  `name` varchar(255) collate utf8_unicode_ci default NULL,
  `language` varchar(255) collate utf8_unicode_ci default NULL,
  `place_type` varchar(255) collate utf8_unicode_ci default NULL,
  `ancestry` varchar(255) collate utf8_unicode_ci default NULL,
  `activity_count` int(11) default '0',
  `activity_count_updated_at` datetime default NULL,
  `bounding_box` blob,
  `slug` varchar(255) collate utf8_unicode_ci default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `index_geoplanet_places_on_woeid` (`woeid`),
  KEY `index_geoplanet_places_on_ancestry` (`ancestry`),
  KEY `index_geoplanet_places_on_parent_woeid` (`parent_woeid`),
  KEY `index_geoplanet_places_on_slug` (`slug`),
  KEY `index_geoplanet_places_on_name` (`name`),
  KEY `index_geoplanet_places_on_place_type` (`place_type`)
) ENGINE=InnoDB AUTO_INCREMENT=5652569 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

EXPLAIN

id 1
select_type SIMPLE
table geoplanet_places
type    ALL
possible_keys   index_geoplanet_places_on_place_type
key NULL
key_len NULL
ref NULL
rows    441273
Extra   Using where
  • 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-19T17:37:46+00:00Added an answer on May 19, 2026 at 5:37 pm

    You can switch the storage engine of the table to MyISAM to take advantage of full text indexing.

    The name index wont help you unless you change the like to LIKE 'San Diego%' which can do a prefix search on the index

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

Sidebar

Related Questions

I've recently added the JQuery autocomplete plug in and have a textbox that autocompletes
I use JQuery plugin autocomplete as a kind of dataset chooser. If the user
I'm using the following JQUERY Autocomplete plug-in: jQuery Plugin: Tokenizing Autocomplete Text Entry What'd
I m using autocomplete from http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ i managed to get data from server in
I have a tagging plugin similar to that of SO. I use jQuery.ui's autocomplete
I recently added JQuery's date-picker control to a project. In Internet Exploder, I get
I added the columns in the select list to the order by list, but
In the jQuery autocomplete/menu widget (the autocomplete widget is based on the menu widget,
I have a jQuery autocomplete fild which gets existing data from my MVC action.
I'm working with jQuery UI autocomplete plug-in for my web application. It works perfectly

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.