What information should be provided when asking how to improve the performance of a query?
As many of the following as possible:
- Database product, precise version, and edition.
- Formatted text of the query/procedure/function.
- Current and desired performance levels.
- Things you can and cannot change (e.g. can add indexes, cannot change the query).
- Query plans
- Ideally the post-execution variety, containing runtime information.
- Estimated execution plans (if obtaining a post-execution plan is not practical).
- Anonymized plans are acceptable, but may limit answer quality.
- A picture of an execution is occasionally enough (but discouraged).
- A link to a demo that reproduces the core of the problem.
- Or table, index, and constraint definitions (scripts).
- Hardware (e.g. memory/CPU/storage) and OS information.
- The tuning steps followed so far.
- The query-performance tag.