Re: Query optimization

From: Mark <i_at_dontgetlotsofspamanymore.invalid>
Date: Mon, 13 Jan 2014 10:05:33 +0000
Message-ID: <nfe7d99o7db914go836jclmlbdege55j1c_at_4ax.com>


On Sat, 11 Jan 2014 11:55:54 +0100, Robert Klemme <shortcutter_at_googlemail.com> wrote:

>On 10.01.2014 17:33, Mark wrote:
>> On Fri, 10 Jan 2014 14:44:46 GMT, "Ken" <ktsahl_at_yoohoo.com> wrote:
>
>> The query is as simple as this:
>>
>> SELECT column FROM table WHERE x = 'a' AND y = 'b' AND z = 1;
>>
>> There is an index on x, y and z.
>
>Do you mean "there is a covering index on (x, y, z)" or do you mean
>"there is an index on x, an index on y and an index on z"? If the
>latter, try the covering index with the most selective column first.

The former.

>> Anyway my client has solved the problem by setting the statistics to
>> NULL.
>
>Other queries aren't hurt?

This is the most critical query from a performance perspective. If I have understood the documentation correctly this is recommended for tables where the data changes rapidly.

-- 
(\__/)  M.
(='.'=) If a man stands in a forest and no woman is around
(")_(") is he still wrong?
Received on Mon Jan 13 2014 - 11:05:33 CET

Original text of this message