we experienced very bad performance with many to many relations when using REST GET requests with parameter “related”.
We have about 300 records in a table “trainings” and 60 records in a table “targetgroups”. They are connected with an intermediate table “trainings_targetgroups” which contains 200 records.
Getting only the trainings without related data is done in 650 ms. That’s fairly ok.
But getting the trainings with related targetgroups needs more than 8500 ms. This is not usable in production.
Database is MySQL. Getting the same data (with related targetgroups) from the same server with an own php script that generates similar JSON response is done in 880 ms (also with ORM).
We experienced this on different servers with different MySQL databases and this behaviour is reproducable for each installation.
We are using Dream Factory Version 2.1.2 with Apache running on Ubuntu 14.04 Servers.
Is there anything we could change in our configuration to get a better performance?