Could it be a difference in parallel queries? (I don't remember when those were added.) Certainly, a union is an example of something that will clearly get multiple workers. -- Scott Ribe scott_ribe@xxxxxxxxxxxxxxxx https://www.linkedin.com/in/scottribe/ > On Mar 8, 2023, at 6:29 AM, Neimar Sierota <neimarsmo@xxxxxxxxx> wrote: > > I did a test as you mentioned and in postgresql version 11 I didn't observe any change in memory consumption while the query is executed. With version 14, running the same query, it is possible to observe a considerable increase in memory usage during execution. > Could it be a bug in postgresql's memory management?