What precision do you need? if it’s a state/national wide search maybe you could do a lat-lon to zip lookup and have precomputed distance from zip area to zip area of the restaurant. If you need accurate distances that won’t be a good option.
You should look into a Geohash solution, in the Wikipedia article there is a link to a PHP library to encode decode lat long to geohashs.
Here you have a good article explaining why and how they use it in Google App Engine (Python code but easy to follow.) Because of the need to use geohash in GAE you can find some good python libraries and examples.
As this blog post explains, the advantage of using geohashes is that you can create an index on the MySQL table on that field.
Related Posts:
- What is copy-on-write?
- What is the purpose of the “role” attribute in HTML?
- Most efficient way to increment a Map value in Java
- Image rotation algorithm
- Refactoring WordPress to improve memory performance [closed]
- How can I implement a location based (zip code) search in WordPress?
- Why is home (a lot) slower than other pages?
- Long Waiting Times on GoDaddy? [closed]
- What’s the case against transient-ing almost everything that’s mostly static?
- I have geocoded posts with latitude longitude – How to search by radius?
- Post queries by latitude and longitude
- Is there a way to measure server resource (CPU) usage by WP plugins?
- wordpress with 1.5 million posts
- Any suggestions on how to make this function more efficient or more generally useful?
- better wordpress minify problem
- Compressing JS and CSS
- Is there a way to ensure local fonts load from CDN when CDN is enabled?
- Disable Garbage Collection? [closed]
- Does WP Super Cache really compress my pages? [closed]
- How to prevent Vimeo duplicate requests?
- Need to optimize wordpress websites on google pageinsight
- Number of queries in wordpress
- Combine several CSS files into one
- My website is slow on the initial load
- What are some ways to speed up a WordPress site that most people don’t know? [closed]
- What’s the best way to search for a UPC code in a Database?
- Optimum way to compare strings in JavaScript?
- How can you profile a Python script?
- Cleanest way to copy a constant size array in c++11
- How to efficiently remove duplicates from an array without using Set
- Big O, how do you calculate/approximate it?
- Why is Fetch task in Hive works faster than Map-only task?
- SQL: How to properly check if a record exists
- Fastest way to put contents of Set
to a single String with words separated by a whitespace? - Steps to optimize WordPress in regard to server load and website speed?
- How to Optimize WP site for millions of posts
- Optimize post insert and delete for bulk operations?
- How to cache json with wp-super cache
- WordPress (MyISAM) database is slow, should I switch to InnoDB?
- How to benchmark a WordPress installation? [closed]
- What is a good alternative to using $content_width for image optimization?
- WP_Query leaking absurd amounts of memory
- Is there a way to display all my posts on a single Google Map?
- What’s a good strategy for planning WordPress DB growth?
- Set Alias for meta_query arguments in get_posts()
- Make Google index the entire post if it is separated into several pages
- How do I optimize a custom post type admin page with 25,000 posts?
- Separate Database Tables For Different Post Types
- How to prevent execution of default query, while preserving ability to use WP_Query in template?
- Scaling a WP eCommerce site
- Safe to disable wptexturize?
- Running WordPress on low-end hardware/resources?
- Is it possible to wrap Geo Location search around WP_Query?
- Optimize Multiple Taxonomy Term MySQL Query?
- Where should I host my images?
- Website is slow: advice on optimization
- Preventing YouTube embeds loading multiple instances of player JS?
- Geo Sorting Post
- Best way to show map of tagged posts?
- Is checking whether the blog is installed necessary?
- How to remove in the wordpress database all posts revisions except the last three?
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- Easy way to process search results before displaying
- Speeding Up Bulk Post Creation – wp_insert_post & update_post_meta
- How to properly insert a stylesheet in wp_head
- Create multiple Search functions for posts / custom post types and everything
- How to solve ‘Eliminate render-blocking JavaScript and CSS in above-the-fold’ content for multiple files?
- Settings to get the most out of W3 Total Cache
- How to solve slow WordPress site caused by attachment_metadata
- Minimal WordPress load for only `get_option` to work (because ajax…)
- Most efficient way to list all categories and display a post for each of them?
- Dynamic User State & City selection
- Adding session variable and/or cookie based on user-selected input
- Defer Code in Widgets – Page Speed
- Speed up WordPress
- Show posts on a Google Map
- If I consider changing my WordPress DB tables to InnoDB, will it have an effect on the way WordPress works?
- Using Multiple Queries of “home_url” vs. Calling a Variable Multiple Times
- Splitting the main query in multiple loops with query_posts and/or pre_get_posts?
- Disable unneeded scripts in a wordpress installation
- Image sizes and order of operations
- Performance-wise, is it better to enqueue a (small) script on every page or test to see if it’s needed?
- How can I automatically attach posts to a map?
- WordPress Query is taking more then 20 second and stuck on creating index
- Could a higher number of registered image sizes affect performance?
- Publish a message on facebook after having posted a comment
- How do I edit the htaccess file to optimize my website?
- Geo Targeting articles on a WordPress site [closed]
- Continue execution after WP REST API response
- Can’t move jQuery to footer
- Custom Post for Locating by Google Maps API
- Should I remove transients from the wp_options table?
- Optimizing WordPress’s styles and scripts
- What’s faster? One big query, or several smaller ones?
- How to optimize my query filtering out unwanted data?
- Improve wp query perfomance on large db
- Can I prevent “wp_user_level” from getting added to wp_usermeta on registration?
- How to stop wp_postmeta from being called on archive and search pages?
- Very Slow Page – How to Optimize # of Queries?
- WordPress hosting optimized servers – Is this just a sales gimmick? [closed]