| Many DBMS handle SQL with literals differently than SQL with parameters which is probably the cause for the different performance you see. Note that the performance is data dependent. The order of the joins in the SQL is irrelevant. SQL is a declarative language and will optimize/reorder the joins anyway. What you need is literal inlining or some indexes. Talk to your DBA to see why the query is slow. |