Hi,
I have a simple pipeline ingesting into procedure. That procedure receive lat lng in batch. i have a different table where district (polygon) is present. Now while batchdata comes in, i check GEOGRAPHY_INTERSECTS(other_table.polygon,GEOGRAPHY_POINT(lng,lat)). It takes hell of a time to just pass this statement.
What i did was, created a batchdata_temp table (lat, lng, location computed column as GEOGRAPHY_POINT(lng,lat)). when i inserted batch data into this temp table (doing the same thing with just compute column), this was pretty much efficient.
Why is this so? and what is the best approach to calculate geography_point on the fly?
Can you post both versions of your code, including the create table for other_table? My best guess is that somehow in one version you are able to take advantage of an existing index on other_table.polygon and in the other not.
All this because when i use geography_point(lng,lat) directly in my pipeline, it takes forever. So, i save the whole batch (of millions) in table before processing on it.