Re: totally different plan when using partitions + request

From: Scara Maccai <m_lists(at)yahoo(dot)it>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: totally different plan when using partitions + request
Date: 2009-08-13 14:49:22
Message-ID: 831206.41080.qm@web24604.mail.ird.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> >     -> Index Scan using
> teststscell13_pkey on teststscell13 data1 (cost=0.0..3.9
> rows=1 width=16) (actual time=0.006..0.006 rows=0
> loops=285)
> >
> > doesn't make any sense: that table will never have any
> data.
> > I'd like to have a way to tell that to Postgresql...
>
> It's one index probe and takes virtually no time at all.
> That's not your problem.
>

Put that in a 60000 nested loop and it won't be "virtually no time at all" I'm afraid... to the planner that "3.9 cost" almost the same as an index scan on a populated table...
Hence the planner uses a different plan.

Otherwise I don't see why the 2 plans should be different...

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Roderick A. Anderson 2009-08-13 14:54:36 Re: PostgreSQL for Firefox Bookmarks?
Previous Message Richard Huxton 2009-08-13 14:30:52 Re: totally different plan when using partitions + request