I have a view which uses many tables, and statements and functions. It is very slow, the main reason being that I only have read-only access to the main tables which do not have the appropriate indexes, so joins evaluate very slowly.
Following some advice I have broken the joins down using temporary tables, to ensure that every join has indexed fields on both sides. This has worked very well. If I run a select to pull the final output it runs 60x quicker than previously. However I cannot use this to drive the necessary view, as views cannot refer to temporary tables.
Are there any alternatives to temporary tables, or different approaches I could take?
Thanks