Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
admin:optimization:geo:optimization [2010/07/29 02:15]
els
— (current)
Line 1: Line 1:
-{{page>:​top_add&​nofooter&​noeditbtn}} 
  
-====== Geographic Searches ====== 
- 
-[[admin:​optimization:​geo:​home|Overview]] -> [[admin:​optimization:​geo:​latlong|Latitude and Longitude]] -> [[admin:​optimization:​geo:​radius|Radius Distance Searches]] -> [[admin:​optimization:​geo:​indexing|Indexing]] -> **[[admin:​optimization:​geo:​optimization|Optimization]]** 
- 
-===== Optimizing Geographic Searches ===== 
- 
-Geographic searches are specified using a [[dev:​sql:​functions:​distance|$DISTANCE function]]. ​ As long as there is a multi-column Omnidex index containing the latitude and longitude, the $distance function will be automatically optimized. 
- 
-===== Examples ===== 
- 
-The following are examples of several types of geographic searches that can be optimized using the $distance function. 
- 
-==== Example 1: Distance between two sets of coordinates ==== 
- 
-<​code>​ 
-select ​     $distance(40.0,​ -105.0, 41.0, -106.0) distance 
-  from      $omnidex; 
- 
-</​code>​ 
- 
-==== Example 2: Distance between two sets of coordinates using columns ==== 
- 
-<​code>​ 
-select ​     zip, 
-            $distance(40.0,​ -105.0, latitude, longitude) distance, ​ 
-            latitude, longitude, 
-  from      zipcodes 
- ​where ​     $distance(40.0,​ -105.0, latitude, longitude) < 10; 
- 
-</​code>​ 
- 
-==== Example 3: Distance between an origin and multiple sets of destination coordinates ==== 
- 
-<​code>​ 
-select ​     state, zip, latitude, longitude 
-   ​from ​     zipcodes 
-  where      $distance(latitude,​ longitude, 
-                       ​(select ​     latitude, longitude 
-                          from      zipcodes 
-                         ​where ​     state = '​CO'​)) < 5; 
-</​code>​ 
-  
-**[[admin:​optimization:​geo:​indexing|Prev]] ** 
- 
-====== Additional Resources ====== 
- 
-  * [[admin:​optimization:​home|Optimization Strategies]] 
-  * [[admin:​optimization:​geo:​math|The Math Behind Geographic Searches]] 
-  * [[dev:​sql:​functions:​distance|$DISTANCE function]] 
- 
-{{page>:​bottom_add&​nofooter&​noeditbtn}} 
 
Back to top
admin/optimization/geo/optimization.1280369734.txt.gz ยท Last modified: 2012/10/26 14:52 (external edit)