[postgis-devel] Cube Indexes

Markus Schaber schabi at logix-tt.com
Tue Aug 15 04:37:23 PDT 2006


Hi, Mark,

Mark Cave-Ayland wrote:

> typedef struct NDBOX
> {
> 	unsigned int size;			/* required to be a Postgres varlena type */
> 	unsigned int dim;
> 	double		x[1];
> }
> 
> 
> So we'd have to keep the unsigned int in order to function with
> PostgreSQL, but we may possibly be able to reduce the dimension element
> to an unsigned char to give just over 25% increase in storage space.

The dimension element is redundant.

If we use floats, dim=(size-4)/4 and size=(4*dim)+4, for doubles it is
dim=(size-4)/8 and size=(8*dim)+4.

For doubles, it may be better to pad to 64 bit offsets on most
platforms, and thus keeping the second unsigned int, however.

HTH,
Markus

> My preference would be just to have one set of index methods to cover
> all dimensions rather than having multiple copies of some of the most
> complex code in PostGIS. Given that most modern systems are now equipped
> with sophisticated caching algorithms, and also that index scans are
> generally only used to extract small portions of data from a table, in
> my opinion there would have to be a very convincing performance
> improvement to justify the cost of maintaining multiple index operator
> classes, operators and statistics within PostGIS.
> 
> 
> Kind regards,
> 
> Mark.
> 
> 
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel


-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org



More information about the postgis-devel mailing list