When it comes to optimizing your CakePHP queries, you need to abandon Recursive and adopt Containable.
In the example below I have the following models:
- Patient
- Specimen
- Result
- ResultType
The associations in the model are:
- Result
- belongsTo
- ResultType
- hasMany
- Result
- hasMany
- Patient
- hasMany
- Result
- Specimen
- hasMany
- Specimen
- belongsTo
- Patient
- hasMany
- Result
- belongsTo
- ResultType
- belongsTo