开发者

What does SQL Server do for spatial data outside the bounding box of the index?

开发者 https://www.devze.com 2023-01-11 04:53 出处:网络
I read an article that says: The (x-min,y-min) and (x-max,y-max) coordinates determine the placement and dimensions of the bounding box.

I read an article that says:

The (x-min,y-min) and (x-max,y-max) coordinates determine the placement and dimensions of the bounding box. The space outside of the bounding box is treated as a sin开发者_如何学运维gle cell that is numbered 0.

I took this to mean that everything "outside" the index is actually indexed in a special place, so if I do something like:

SELECT * FROM GeometryTable WHERE @MyShape.STContains(GeometryColumn)

Where @MyShape is entirely outside the bounding box, it should only check things outside of the bounding box (so it still uses the index).

But later, the article says:

Only operations computed on objects that are entirely inside of the bounding box benefit from the spatial index.

Which seems to say the opposite -- that if @MyShape is outside the bounding box, it will do a full table scan.

Which is it?

0

精彩评论

暂无评论...
验证码 换一张
取 消