Re: Sub-optimal plan chosen

Поиск
Список
Период
Сортировка
От bricklen
Тема Re: Sub-optimal plan chosen
Дата
Msg-id 33b743250909101102kbd38b4an67d89274c053402e@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Sub-optimal plan chosen  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
On Thu, Sep 10, 2009 at 10:56 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
bricklen <bricklen@gmail.com> writes:
> I just created a new index as Tom said, and the query *does* use the new
> index (where ofid precedes date in the definition).

And is it indeed faster than the other alternatives?

                       regards, tom lane

About the same as the earlier, faster plan:

 Aggregate  (cost=2342.79..2342.80 rows=1 width=8) (actual time=8.433..8.433 rows=1 loops=1)
   ->  Index Scan using statsdaily_ofid_date on statsdaily  (cost=0.00..2330.61 rows=4873 width=8) (actual time=0.089..5.043 rows=3125 loops=1)
         Index Cond: ((ofid = 38) AND (date >= '2009-09-01'::date) AND (date <= '2999-01-01'::date))
 Total runtime: 8.470 ms

В списке pgsql-performance по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Sub-optimal plan chosen
Следующее
От: Vincent de Phily
Дата:
Сообщение: Re: slow query : very simple delete, 100% cpu, nearly no disk activity