Re: QUERY Tune

Here's a good, simple minimum for the information needed to tune a query
reasonably efficiently:

-The current execution plan.
-The list of indexes on the tables, with their columns, in order, and which of
these are unique.
-The selectivity (as a percentage of rows in the affected table) of
single-table
conditions mentioned in the WHERE clause, such as "live_p = 't'"
-The complete view-defining query text of any views mentioned in the SQL, as
well as any views mentioned in those views,...
-The number of rows the query returns.
-The number of rows and name of the biggest table (sanity check, combined with
the previous datapoint to determine whether the usual assumptions about filter
independence and rowcounts before and after joins hold).
-The current runtime of the query.
-The target runtime of the query (helps determine how radical the solution
might
need to be).