I need to store locations as lat long point, I tried to do comparison between postgresql point type and postgis geometry point in term of size using avg(pg_column_size:
select
avg(pg_column_size(latlong_geomitry)) as postgis_average_size,
avg(pg_column_size(latlong_point)) as point_average_size
from points;
for the same entry:
postgis geometry point storage size is 29 byte
postgresql point storage size is only 16 byte
I prefer to use postgis geometry point, however I don't understand why it takes more bytes to store the same data than ordinary point.
I don't need any calculation on locations (ex: distance between or any spatial features..)
So, is it ok to go with postgresql point type rather than postgis geometry point? I will preserve storage size, but would I lose in the other hand? What would be the advice?
Postgis geometries contains also the type (POINT, POINTZ etc) and the SRID. This could explain the difference in size.
If you don't need calculations, and you don't have any other table with postgis geometries, I'd go with the native point and save storage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With