Re: Statistics and selectivity estimation for ranges

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: Statistics and selectivity estimation for ranges
Дата
Msg-id CAPpHfdtHXh+xuJzKBbzK1NFjbtia5vzK35uJiXgiKE9oaqmtOg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Statistics and selectivity estimation for ranges  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
Hi, Jeff!

Thanks a lot for review!

On Mon, Dec 10, 2012 at 11:21 PM, Jeff Davis <pgsql@j-davis.com> wrote:
It looks like there are still some problems with this patch.

  CREATE TABLE foo(ir int4range);
  insert into foo select 'empty' from generate_series(1,10000);
  insert into foo select int4range(NULL, g, '(]')
    from generate_series(1,1000000) g;
  insert into foo select int4range(g, NULL, '[)')
    from generate_series(1,1000000) g;
  insert into foo select int4range(g, ((g*1.01)+10)::int4, '[]')
    from generate_series(1,1000000) g;
  CREATE TABLE bar(ir) AS select * from foo order by random();
  ANALYZE bar;

Now:
  EXPLAIN ANALYZE SELECT * FROM bar
    WHERE ir @> int4range(10000,20000);

The estimates are "-nan". Similar for many other queries.

Oh, yeah! It appears that infinities require much more cautious work with them than I supposed. That should be fixes in the attached version of patch. However, it require significant rethinking of comments. Will update comments and address your questions in a couple of days. Could you recheck if attached patch really fixes problem you reported?

------
With best regards,
Alexander Korotkov.
Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Logical decoding & exported base snapshot
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: gistchoose vs. bloat