On Wed, Mar 31, 2010 at 4:06 AM, Nathan Rixham <nrix...@gmail.com> wrote:
> Tommy Pham wrote:
>>
>> As for spatial data types, I've never find much use for non scientific
>> related.  (example) If using point as a PK, if MySQL stores it the
>> same way as PostgreSQL which is 16 bytes, how is that any different -
>> performance wise - than using UUID and storing it as binary(16) for
>> MySQL or uniqueidentifier (16 bytes) for PostgreSQL?
>>
>
> it's all about the indexing (R-Tree)
>
> http://en.wikipedia.org/wiki/R-tree
>

I can see where the performance would be between B-Tree vs R-Tree for
the same field size but I've yet to see real life application of it.
Case in point, if using point for GPS data coordinates, then wouldn't
it still be a lot better to use Lon (float), Lat (float) which is 2
fields of 4 bytes each vs 1 field of 16 bytes?  The index would still
be faster (8 bytes less) in B-Tree right?  Not to mention smaller row
& DB size.  As for calculating the distance between 2 'points', it
would be simpler for querying purposes to use 'point'.  ATM, I don't
have need to do any such calculations.  If I do use 'point' for PK,
I'd run into problems with scaling and migration later.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to