3

Would a MBR function query against an indexed column with geometry type containing points and polygons (GeomCollection type) be slower than a MBR function against an indexed column with a polygon type?

My programmer instincts tell me that it would be slower and I should use the most descriptive spatial type I can.

Edit: After reading Denis's answer, the real question is:

In MySQL "does an indexed column with geometry type containing points and polygons actually contain the latter or are they reduced to a MBR?"

2
  • Sorry, but I really do not know. What is "MBR"? Commented Jun 9, 2011 at 19:10
  • Ah, "Minimum Bounding Rectangle". Commented Jun 9, 2011 at 19:19

1 Answer 1

1

I'm risking an answer here, without being sure on the MySQL front...

But in Postgres, geometry types indexed using GIST will usually be indexed as boxes, a.k.a. MBR, irrespective of what whether they're circles, polygones, etc.

So the real question might be better rephrased as: "does an indexed column with geometry type containing points and polygons actually contain the latter or are they reduced to a MBR?"

Sign up to request clarification or add additional context in comments.

2 Comments

@Nate: in that case, I'd hazard a yes. (I wouldn't be doing so if MySQL had wizards around that were better at using and optimizing R-tree indexes than the Postgres folks. But the fact is, they don't. Postgres offers Generalized Inverted Search Tree indexes and Generalized Inverted Indexes; both are better. The former, in PG 9.1, allows to leverage an index for k-nearest searches, something that MySQL isn't doing to date. And both work in an ACID compliant environment, whereas MySQL still requires MyISAM for spacial indexes.)
Okay, I thought that might be the case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.