Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

What produces the best performance in regular google app engine use, a polymodel or a normal "BigTable" model?

The polymodel, effectively, creates a column in the parent table called "class" which provides the inheritance tracking. Whereas a normal bigtable, inherited from a parent class, creates a new and separate data structure, without the ability to query the parent and find all children of all subtyped classes.

share|improve this question

1 Answer 1

There probably is a performance difference, but it's probably pretty small.

Here's what I found (all based on the the Google Docs for Python).

  1. BigTable does not support PolyModel information natively. Instead, it's implemented using a 'class' property. So, when you try to perform a search, for example, to find a base class, you will be searching on this 'class' property.

  2. All queries that use the PolyModel class have an extra filter applied that filters by the given class (using the 'class' property).

  3. Any indexes created for a PolyModel class, must take into account the extra 'class' column.

Essentially, the PolyModel class takes care of the 'class' property on its own, inserting it into queries and utilizing for other queries. Other than that, it works identical to standard BigTable usage.

So, the difference is really just adding and maintaining one extra column.

Is there a performance difference? Yes, probably so. Every column you add to any database system is going to have a performance impact. But, is it significant? Probably not.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.