When we're displaying layers which are compatible with the current project and come from the preferred layer source we have have to do quite a lot of work for each layer. If we could split up the dataset by layer source and then work backwards from there if needed with an abstraction so that it's done transparently in the views/templates.
The toaster performance is pretty important so let's try to tackle this early on. Toaster's recipes, machines and layers tables are all affected by this, ideally we shouldn't be blocking 5 seconds or more on retrieving this data on a 4 core/8 gig ram/ssd hardware. I propose that all the processing on layers/equivalence/compatibility should be removed in favour of the database being re-organised so that the data in the tables maps to what toaster needs to show.
This issue should be fixed by the refactoring being done for bug #7708 *** This bug has been marked as a duplicate of bug 7708 ***
verified