2 ms·
Loops, joins, making sure there are bind params used in queries so the DB engine will recognize them as the same query, and make sure there are indexes on colum
by matt_s 8y ago
Loops, joins, making sure there are bind params used in queries so the DB engine will recognize them as the same query, and make sure there are indexes on columns being queried.
Also look at data volume. There may be much more data in table(s) after long usage and long after the code was originally written.
If it is a high throughput application you should have monitoring in place that can point you to where slowness may be. Some tools will having timings on queries, loops, HTML/XML generation, etc. If not, get a profiler.
Also make sure you are up to date on the latest stable release of the stack you are running. Performance or bug fixes might help.