Skip to main content
improved formatting
Source Link
Hannah Vernon
  • 71.1k
  • 22
  • 179
  • 326

Fastest What is the fastest way to compare polygon geometry typesdata?

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 

Fastest way to compare polygon geometry types

We have two tables which has polygon geometry stored in them. I would like to fetch the polygons present in one table and not present in another table.. As of now I am doing a left outer join and using STAsText() but it is taking lot of time.. FYI, we have 120 million polygons in both the tables. Is there a fast way of fetching? (maybe using the spatial indexing, I am not aware of this)

select newPolygon.* from table1 newPolygon left join table2 oldPolygon on newPolygon.Shape.STAsText() = oldPolygon.Shape.STAsText() where oldPolygon.Shape is null 

What is the fastest way to compare polygon geometry data?

We have two tables with polygons stored in geometry type columns. 

I want to fetch the polygons present in one table that are not present in another table. 

As of now I am doing a left outer join and using STAsText(), however that is taking a very long time. 

FYI, we have approximately 120 million polygons in both tables. 

Is there a fast way of comparing geometry type data? Maybe I need to use the spatial indexing, however I am not aware of this.

SELECT newPolygon.* FROM table1 newPolygon LEFT JOIN table2 oldPolygon   ON newPolygon.Shape.STAsText() = oldPolygon.Shape.STAsText() WHERE oldPolygon.Shape IS NULL 

We have two tables which has polygon geometry stored in them. I would like to fetch the polygons present in one table and not present in another table.. As of now I am doing a left outer join and using STAsText()STAsText() but it is taking lot of time.. FYI,We we have 120 million polygons in both the tables. Is there a fast way of fetching? (may bemaybe using the spatial indexing, I am not aware of this).

FYI, I am using SQL Server 2012.

Thanks, Balu

select newPolygon.* from table1 newPolygon left join table2 oldPolygon on newPolygon.Shape.STAsText() = oldPolygon.Shape.STAsText() where oldPolygon.Shape is null 

We have two tables which has polygon geometry stored in them. I would like to fetch the polygons present in one table and not present in another table.. As of now I am doing a left outer join and using STAsText() but it is taking lot of time.. FYI,We have 120 million polygons in both the tables. Is there a fast way of fetching? (may be using the spatial indexing, I am not aware of this).

FYI, I am using SQL Server 2012.

Thanks, Balu

We have two tables which has polygon geometry stored in them. I would like to fetch the polygons present in one table and not present in another table.. As of now I am doing a left outer join and using STAsText() but it is taking lot of time.. FYI, we have 120 million polygons in both the tables. Is there a fast way of fetching? (maybe using the spatial indexing, I am not aware of this)

select newPolygon.* from table1 newPolygon left join table2 oldPolygon on newPolygon.Shape.STAsText() = oldPolygon.Shape.STAsText() where oldPolygon.Shape is null 
Source Link
Balu
  • 71
  • 2
  • 4

Fastest way to compare polygon geometry types

We have two tables which has polygon geometry stored in them. I would like to fetch the polygons present in one table and not present in another table.. As of now I am doing a left outer join and using STAsText() but it is taking lot of time.. FYI,We have 120 million polygons in both the tables. Is there a fast way of fetching? (may be using the spatial indexing, I am not aware of this).

FYI, I am using SQL Server 2012.

Thanks, Balu