So, I mentioned in my MySQL Cluster post that I found out that cluster and joins don’t get a long too well. There are a couple of tips I have for using joins or replacing them with other techniques that I thought I would share.
Here are some things I keep in mind when using the NDB engine. These may apply to the other engines as well.
- Test using the NDB engine. Testing against another engine is not adequate.
- Avoid JOIN if you can, test often if you can’t
- Avoid subqueries always
- Select using primary keys when at all possible. Always select using a key.
- Be sure to include both your where and order by columns in your keys.
Try your join from several directions.
Sometimes, the way you join can affect the engine. This is more …
[Read more]