Re: Sub-optimal plan chosen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 10, 2009 at 10:56 AM, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
bricklen <bricklen@xxxxxxxxx> 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

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux