First of all, inheritance has not a natural translation to relational database architecture (ok, I know, Oracle Type Objects and some other RDBMS support inheritance but django don't take advantage of this functionality)
At this point, notice than django generates new tables to subclasses and write lots of left joins to retrieve data from this 'sub-tables'. And left joins are not your friends. In a high performance scenario, like a game backend or something else, you should avoid it and resolve inheritance 'by hand' with some artifacts like nulls, OneToOne or foreign keys. In OneToOne scenario, you can call the related table directly or only if you need it.
... BUT ...
"In my opinion (TGW)" you should to include model inheritance in your enterprise projects when it catches to your universe of discourse. I do this, and I save a lot of development hours to my customers thanks to this feature. Also, code becomes clean and elegant and that means easy maintenance (notice that this kind of projects don't have hundreds or requests by second)
Question by question
Q: What is wrong with this kind of inheritance in Django?
A: Lot of tables, a lot of left joins.
Q: Why are explicit OneToOneFields better?
A: You can access directly to related model without left joins.
Q: Are there any illustrative examples (benchmarks)?
A: No comparable.
Q: Does not select_related() allow us to control when JOINs are invoked?
A: django joins needed tables.
Q: What are the alternatives to multi-table inheritance when I need to reference a base class in another model?
A: Nullification. OneToOne relations and lots of code lines. It depends on application needs.
Q: Are GenericForeignKeys better in this case?
A: Not for me.
Q: What if I need OneToOneField to base model?
A: Write it. There is no problem with this. For example, you can extend User model, and also you can have a OneToOne to User base model for some users.
Conclusion
You should to know the cost of write and maintenance code without model inheritance also the cost of hardware to support model inheritance applications and act accordingly.
Just a joke: you can write it on assembly code, and it will run faster.
Quoting Trey Hunner:
Answer from dani herrera on Stack OverflowYour time is usually much more expensive than your CPU's time.
First of all, inheritance has not a natural translation to relational database architecture (ok, I know, Oracle Type Objects and some other RDBMS support inheritance but django don't take advantage of this functionality)
At this point, notice than django generates new tables to subclasses and write lots of left joins to retrieve data from this 'sub-tables'. And left joins are not your friends. In a high performance scenario, like a game backend or something else, you should avoid it and resolve inheritance 'by hand' with some artifacts like nulls, OneToOne or foreign keys. In OneToOne scenario, you can call the related table directly or only if you need it.
... BUT ...
"In my opinion (TGW)" you should to include model inheritance in your enterprise projects when it catches to your universe of discourse. I do this, and I save a lot of development hours to my customers thanks to this feature. Also, code becomes clean and elegant and that means easy maintenance (notice that this kind of projects don't have hundreds or requests by second)
Question by question
Q: What is wrong with this kind of inheritance in Django?
A: Lot of tables, a lot of left joins.
Q: Why are explicit OneToOneFields better?
A: You can access directly to related model without left joins.
Q: Are there any illustrative examples (benchmarks)?
A: No comparable.
Q: Does not select_related() allow us to control when JOINs are invoked?
A: django joins needed tables.
Q: What are the alternatives to multi-table inheritance when I need to reference a base class in another model?
A: Nullification. OneToOne relations and lots of code lines. It depends on application needs.
Q: Are GenericForeignKeys better in this case?
A: Not for me.
Q: What if I need OneToOneField to base model?
A: Write it. There is no problem with this. For example, you can extend User model, and also you can have a OneToOne to User base model for some users.
Conclusion
You should to know the cost of write and maintenance code without model inheritance also the cost of hardware to support model inheritance applications and act accordingly.
Just a joke: you can write it on assembly code, and it will run faster.
Quoting Trey Hunner:
Your time is usually much more expensive than your CPU's time.
The world has changed.
The first thing to note is that the article titled Django gotcha: concrete inheritance was nearly four years old at the time this question was asked; in 2014. Both Django and RDBMs systems have come a long way since then (example mysql 5.0 or 5.1 were the widely used versions and 5.5 general availability was still one month away).
Joins to my left, joins to my right
It is true that multi table inheritance does result in extra joins behind the scenes most of the time. But joins are not evil. It's worth noting that in a properly normalized database, you almost always have to join to fetch all the required data. When proper indexes are used, joins do not include any significant performance penalties.
INNER JOIN vs LEFT OUTER JOIN
This is indeed the case against multi table inheritance, with other approaches it's possible to avoid a costly LEFT OUTER JOIN and do an INNER JOIN instead or perhaps a subquery. But with multi table inheritance you are denied that choice
When is multi-table inheritance worth using?
How to store different payment types using multi-table inheritance in single Order model?
postgresql - Django Multi Table Inheritance and Preserving Child and Child History - Database Administrators Stack Exchange
Multi-table inheritance - how to use inherited id for relations?
Videos
I've often seen warnings against using multi-table inheritance with Django models, and I can understand why - you end up doing queries across two, or multiple, tables instead of one.
But a site I'm planning seems like a good case for it, and I'd like to sense check things...
I'm going to be storing copies of things like Tweets, Flickr photos, Foursquare checkins, etc. Sometimes I'll want to list these mixed together - eg, all of the most recent tweets, photos and checkins, or all of those posted on a single day. So, not as separate lists, but one mixed list of all types in chronological order.
It seems to me that this would be easier with multi-table inheritance. I could have a parent model that's something like:
class Item(models.Model):
title = models.CharField()
posted_time = models.DateTimeField()
...And then inherit that for each type, eg:
class Tweet(Item):
...
class Photo(Item):
...Then it would be easy to select the most recent items, or those from a particular timeframe, ordered by time, across all different types. But I'm wary... does this sound like a bad idea? Is it still not worth using multi-table inheritance?