Tag Info

New answers tagged

1

Mathematically, disjoint = not intersects. As to which is faster, according to the documentation on spatial indexes at http://msdn.microsoft.com/en-us/library/bb895265.aspx#methods , a spatial index can be used for a query containing geometry1.STIntersects(geometry2) = 1. Strangely enough, geometry1.STDisjoint(geometry2) = 0 is not listed.


1

To populate the following table from your geom table CREATE TABLE location ( parentLocationID INT, LocationId INT NOT NULL, LocationName VARCHAR(100) NOT NULL, Location GEOMETRY NOT NULL ); The following inserts should work. Edit: I have added a Buffer to work around a bug with ST_CONTAINS Bug Link -- Insert Top Level Locations -- ...


1

Your location table should have a self-reference. Use the Polygon1 type for your geography. eg: LocationId (Primary key, not null) LocationSequence (int, not null) LocationName (string, not null) parentLocationId (int, can be null) Geographical data (POLYGON , not null) So, your table might have: 1001, 1, World, null, ? 1002, 1, US, 1001, ? 1003, 2, ...


1

It would appear bitwise not in p1.isMale = ~p2.isMale causes the optimiser to pick wrong. Try p1.isMale <> p2.isMale instead


1

The composite type is clean design, but it does not help performance at all. First of all, float translates to float8 a.k.a. double precision in Postgres. You are building on a misunderstanding. The real data type occupies 4 byte (not 8). It has to be aligned at multiples of 4 bytes. Measure actual sizes with pg_column_size(). SQL Fiddle demonstrating ...



Top 50 recent answers are included