Re: Defects with invalid stats data for expressions in extended stats
Вложения
В списке pgsql-hackers по дате отправления:
| От | Michael Paquier |
|---|---|
| Тема | Re: Defects with invalid stats data for expressions in extended stats |
| Дата | |
| Msg-id | aaTX1chtebZ-d55u@paquier.xyz обсуждение исходный текст |
| Ответ на | Re: Defects with invalid stats data for expressions in extended stats (Chao Li <li.evan.chao@gmail.com>) |
| Список | pgsql-hackers |
On Mon, Mar 02, 2026 at 07:39:45AM +0800, Chao Li wrote: > But why do we still explicitly free the stats array? My concern is > mostly about “partial free”: either free everything, or free nothing > and let the memory context clean it up. “Partial free” tends to > confuse code readers, and future readers may keep running into the > same question. Not necessarity. We have plenty of these patterns in the code with such partial frees. At the end, two things tend to take priority: the readability of the code as well as its efficiency because repeated pfree() calls can be more expensive than a memory context cleanup, particularly in hot loops, though doing pfree() calls may be better in some cases. In this case, I see a better argument with the code clarity, as we use the same array for the stats built with attributes and expressions. We also cap the number of expressions to 8, which puts some control. But at the end it does not really matter: in this context ANALYZE makes sure that nothing crosses the processing of a single relation, even with a transaction analyzes a lot of relations (same or different). -- Michael
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера