Enterprise Edition Home |
Express Edition Home |
Previous Page | Next Page Improving Individual Query Performance >
If possible, you might decide to test a query on a system
that does not interfere with production database servers. Even if
you use your database server as a data warehouse, you might sometimes
test queries on a separate system until you understand the tuning
issues that are relevant to the query. However, testing queries
on a separate system might distort your tuning decisions in several
ways.
If you are trying to improve performance of a large query, one
that might take several minutes or hours to complete, you can prepare
a scaled-down database in which your tests can complete more quickly.
However, be aware of these potential problems:
- The optimizer can make different choices in a small database
than in a large one, even when the relative sizes of tables are
the same. Verify that the query plan is the same in the real and
the model databases.
- Execution time is rarely a linear function of table size. For
example, sorting time increases faster than table size, as does
the cost of indexed access when an index goes from two to three
levels. What appears to be a big improvement in the scaled-down
environment can be insignificant when applied to the full database.
Therefore, any conclusion that you reach as a result of tests
in the model database must be tentative until you verify them in
the production database.
You can often improve performance by adjusting your query or
data model with the following goals in mind:
- If you are using a multiuser system or a network, where system
load varies widely from hour to hour, try to perform your experiments
at the same time each day to obtain repeatable results. Initiate
tests when the system load is consistently light so that you are
truly measuring the impact of your query only.
- If the query is embedded in a complicated program, you can extract
the SELECT statement and embed it in a DB–Access script.
Enterprise Edition Home |
Express Edition Home |
[ Top of Page | Previous Page | Next Page | Contents |
Index ]