[postgis-devel] Coordinate compression for native PostGIS geometry storage?

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Tue Mar 10 08:38:53 PDT 2009


Martin Davis wrote:

> Has anyone thought about or tested the idea of compressing the 
> coordinate sequences in PostGIS' internal geometry data structure?
> Typical sequences of ordinates for real-world geometries tend to have a 
> significant number of identical bits at the high end of each number 
> (sometimes as much as 40%).  With a suitable encoding method a lot of 
> this redundancy could be squeezed out.
> This is obviously a time/space trade-off - but CPU is so much faster 
> than disk I/O it seems like it could be a win to compress.
> 
> Perhaps something to discuss with the big brains at the code sprint...

Martin,

Just for reference PostgreSQL automatically compresses geometries larger 
than 2K for storage on disk. However, we have seen that there is 
considerable overhead involved with access because at the moment the 
geometry has to be decompressed on *every* access to the geometry which 
is expensive. There is talk of setting up a per-query cache to help with 
this, but currently there is no complete implementation available.


HTH,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063



More information about the postgis-devel mailing list