Reply to Re: Suggestions for best practice: mysql vs array sorting

Your name:

Reply:


Posted by Iván Sánchez Ortega on 01/05/07 03:19

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jerry Stuckle wrote:

> Now use the spacial extensions in MySQL, but also filter on the
> longitude and latitude values you computed (in your WHERE clause), i.e.
>
> WHERE long >= elong AND long <= wlong AND lat >= nlat AND lat <= slat

No, you shouldn't do that. If you're using spatial extensions, then define a
bounding box (with GeomFromText('POLYGON blahblahblah') ), then use a
spatial MBR intersection function to filter the data.

The result will be the same (filtering the points by a rectangle centered on
a point). However, by *only* using spatial functions, the Q-trees
algorithms can kick in, and filter the data faster than using four
non-spatial comparisons. After all, that's why Q-trees and spatial stuff
was invented.

- --
- ----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Well, if you're not running Windows, how the hell else are you supposed to
get memory leaks? They don't just grow on B-Trees, y'know!
-- Tackhead, on Slashdot.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFncO5R56dWuhgxGgRAvvoAJ9D2WBkImlUvuiXYBc8q76ryiai9ACfVfcv
vG4d6yRqt9IldEAiqDrwJ60=
=8y+S
-----END PGP SIGNATURE-----

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация