Re: type cache cleanup improvements

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема Re: type cache cleanup improvements
Дата
Msg-id CAJ7c6TP3-bnL5J+fm3-zmXK9WrHxhtQQYdZeFFpba0Eh3j+atg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: type cache cleanup improvements  (Teodor Sigaev <teodor@sigaev.ru>)
Ответы Re: type cache cleanup improvements  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

> > I would like to tweak the patch a little bit - change some comments,
> > add some Asserts, etc. Don't you mind?
> You are welcome!

Thanks. PFA the updated patch with some tweaks by me. I added the
commit message as well.

One thing that I couldn't immediately figure out is why 0 hash value
is treated as a magic invalid value in TypeCacheTypCallback():

```
-       hash_seq_init(&status, TypeCacheHash);
+       if (hashvalue == 0)
+               hash_seq_init(&status, TypeCacheHash);
+       else
+               hash_seq_init_with_hash_value(&status, TypeCacheHash,
hashvalue);
```

Is there anything that prevents the actual hash value from being zero?
I don't think so, but maybe I missed something.

If zero is indeed an invalid hash value I would like to reference the
corresponding code. If zero is a correct hash value we should either
change this by adding something like `if(!hash) hash++` or use an
additional boolean argument here.

-- 
Best regards,
Aleksander Alekseev

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Call perror on popen failure
Следующее
От: Tom Lane
Дата:
Сообщение: Re: type cache cleanup improvements