Re: [BUG?] estimate_hash_bucket_stats uses wrong ndistinct for avgfreq
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: [BUG?] estimate_hash_bucket_stats uses wrong ndistinct for avgfreq |
| Дата | |
| Msg-id | 77386.1772337213@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: [BUG?] estimate_hash_bucket_stats uses wrong ndistinct for avgfreq (Tender Wang <tndrwang@gmail.com>) |
| Ответы |
Re: [BUG?] estimate_hash_bucket_stats uses wrong ndistinct for avgfreq
|
| Список | pgsql-hackers |
Tender Wang <tndrwang@gmail.com> writes:
> In my previous email, I worried rel->tuples may be zero for an empty relation.
> But here it's safe, because an empty relation has no tuples in pg_statistic.
Not sure about that --- it seems possible that after a mass delete,
VACUUM could update pg_class.reltuples to zero without touching
pg_statistic. And I also don't remember whether the planner clamps
rel->tuples to be at least 1. But it doesn't matter. If rel->tuples
is zero, the if-test will prevent us from dividing by zero, and then
we'll leave *mcv_freq as zero meaning "unknown", which seems fine.
It's the same thing that would have happened before bd3e3e9e5.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера