Drupal Database Join I am creating a content type in Drupal - a content management system for our business rules.  This content type will ultimately contain about 40 fields.  I notice that for each field I create for the content, Drupal creates a table in MySQL.

It sounds like when I go to query the content in MySQL from a remote system using, say, JDBC, will I need to create a query joining 40 or so tables?

Does that sound right?  Can I be doing something wrong?  I cannot believe that a query, even with adequate indexes in place, would be performant when 40 tables are joined together.
40 fields on a single content type sounds a lot to me, although I'm aware of sites with a great deal more.


The very first thing you probably want to to, is use Entity Cache which should significantly reduce the query complexity for you, though honestly I haven't examined the module in detail.
Aggresively cache higher up the chain as well. Varnish, Page manager and Cache actions are all your friends here.
Is it possible for you to meaningfully break down the content type into pieces? If you can identify parts of the content type that will not always be necessary, use a Relation to a second content type. At the price of two optional extra joins, you can potentially skip a lot of them.
Still no luck? Define your own content type where all your data columns are properties instead of fields. This will store all data in the same table, at the cost of flexibility. It's probably also possible to make field api do the same thing with fields, but I have never even considered how to do that.