Re: Sub-optimal plan chosen
От | bricklen |
---|---|
Тема | Re: Sub-optimal plan chosen |
Дата | |
Msg-id | 33b743250909101012m4dbc2390wedfe8869f61a1488@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Sub-optimal plan chosen (bricklen <bricklen@gmail.com>) |
Ответы |
Re: Sub-optimal plan chosen
|
Список | pgsql-performance |
On Thu, Sep 10, 2009 at 10:07 AM, bricklen <bricklen@gmail.com> wrote:
Ah, sorry, missed that.On Thu, Sep 10, 2009 at 10:02 AM, Robert Haas <robertmhaas@gmail.com> wrote:On Thu, Sep 10, 2009 at 12:56 PM, bricklen <bricklen@gmail.com> wrote:He's talking about the index definition, not the WHERE clause. The
> On Thu, Sep 10, 2009 at 8:43 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>
>> bricklen <bricklen@gmail.com> writes:
>> > Is there any other data I can provide to shed some light on this?
>>
>> The table and index definitions?
>>
>> The straight indexscan would probably win if the index column order
>> were ofid, date instead of date, ofid. I can't tell if you have
>> any other queries for which the existing column order is preferable,
>> though.
>>
>> regards, tom lane
>
>
> Changing the order of the WHERE predicates didn't help.
order of the WHERE clause is totally irrelevant.
I just created a new index as Tom said, and the query *does* use the new index (where ofid precedes date in the definition).
В списке pgsql-performance по дате отправления: