We have two tables which has polygon geometrywith polygons stored in themgeometry type columns.
I would likewant to fetch the polygons present in one table andthat are not present in another table..
As of now I am doing a left outer joinleft outer join and using STAsText() but it, however that is taking lot ofa very long time..
FYI, we have approximately 120 million polygons in both the tables.
Is there a fast way of fetching?comparing (maybe usinggeometry type data? Maybe I need to use the spatial indexing, however I am not aware of this).
selectSELECT newPolygon.* fromFROM table1 newPolygon left joinLEFT JOIN table2 oldPolygon on ON newPolygon.Shape.STAsText() = oldPolygon.Shape.STAsText() whereWHERE oldPolygon.Shape isIS nullNULL