Re: PG choosing nested loop for set membership?

Поиск
Список
Период
Сортировка
От Brian Crowell
Тема Re: PG choosing nested loop for set membership?
Дата
Msg-id CAAQkdDrytBz6vSJRxBCvuVckdqwHE7LqgqTRHoXGeTTtgSPJGQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PG choosing nested loop for set membership?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Wed, Mar 26, 2014 at 11:43 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> In principle I guess we could somehow merge the stats of y and z
> when looking at a "coalesce(y, z)" expression, but I'm not sure
> how that would work exactly.

Yeah, I'm not sure there's anything to fix here, either. Just a
reminder that coalesces in joins are bad.

The only thing I could think was making an exception for the case when
all inputs to coalesce() have one row. I think that's what's happening
here; coalesce selectivity is estimated at less than one, even though
you can't get a cardinality any less than the inputs (they're already
one), so the nested loop sees an estimate that's less than the product
of its inputs. Or that's my guess anyhow.

Thanks for having a look!

--Brian


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

Предыдущее
От: Steven Schlansker
Дата:
Сообщение: Re: Trimming transaction logs after extended WAL archive failures
Следующее
От: Nithya Soman
Дата:
Сообщение: To monitor the number of PostgreSQL database connections?