Re: Sub-optimal plan chosen
От
bricklen
Тема
Re: Sub-optimal plan chosen
Дата
Msg-id
33b743250909100956t34b410c7wac4f27260b442f78@mail.gmail.com
Ответ на
Re: Sub-optimal plan chosen (Tom Lane)
Список
Дерево обсуждения
Sub-optimal plan chosen bricklen <bricklen@gmail.com>
Re: Sub-optimal plan chosen Tom Lane <tgl@sss.pgh.pa.us>
Re: Sub-optimal plan chosen bricklen <bricklen@gmail.com>
Re: Sub-optimal plan chosen Robert Haas <robertmhaas@gmail.com>
Re: Sub-optimal plan chosen bricklen <bricklen@gmail.com>
Re: Sub-optimal plan chosen bricklen <bricklen@gmail.com>
Re: Sub-optimal plan chosen Tom Lane <tgl@sss.pgh.pa.us>
Re: Sub-optimal plan chosen bricklen <bricklen@gmail.com>
Re: Sub-optimal plan chosen tv@fuzzy.cz
Re: Sub-optimal plan chosen bricklen <bricklen@gmail.com>
Re: Sub-optimal plan chosen tv@fuzzy.cz
Re: Sub-optimal plan chosen Robert Haas <robertmhaas@gmail.com>
Re: Sub-optimal plan chosen bricklen <bricklen@gmail.com>
On Thu, Sep 10, 2009 at 8:43 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
bricklen <bricklen@gmail.com> writes:The table and index definitions?
> Is there any other data I can provide to shed some light on this?
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. The indexes are mostly defined as single-column indexes, with the exception of the "statsdaily_unique_idx" one:
statsdaily_id_pk PRIMARY KEY, btree (id)
statsdaily_unique_idx UNIQUE, btree (date, idaf, idsite, ofid, idcreative, idoptimizer)
statsdaily_date_idx btree (date)
statsdaily_ofid_idx btree (ofid)
statsdaily_ofid_sept2009_idx btree (ofid) WHERE date >= '2009-09-01'::date
В списке pgsql-performance по дате отправления