So, you need it to run faster
Basic steps:
- Is the hardware and OS working together and tuned?
- Is the database system configured correctly? Is is taking
advantage of all resources?
- Is this a typical query, or unusual enough to get special
treatment (e.g. changing parameters) [bulk loads]
- Is there anything else running on the system, even other
database connections, that may affect the results?
- Is the schema sound? Is everything normalized?
- Have the relevant tables been vacuumed and analyzed recently?
Do you have a regular plan?
- Have you considered the effect of triggers, plans, foreign keys,
and functions?
- Do you know the exact business requirements of the query? Do
you really need all the information (and every column) it is
bringing back?
- Is it just this query that is slow, or all queries in general?
- Final step: run EXPLAIN and EXPLAIN ANALYZE to see under the hood
Previous: Query Tuning
[Table of Contents]
Next: Steps of a Query