3 ms·
Excellent answer - thank you. I did some googling, and if you have any specific resources I would love to read more (I was just reading https://www.postgresql.o
by hobs 8y ago
Excellent answer - thank you. I did some googling, and if you have any specific resources I would love to read more (I was just reading https://www.postgresql.org/docs/11/planner-optimizer.html https://www.postgresql.org/docs/11/planner-optimizer.html)
A question - if the planner knows its joining to the TOAST table, and it has some predicate to evaulate, how does it know all the widths of all the rows so it doesnt over-grant(or are memory grants not a thing?)
Generally with statistics/histograms you get a sample and a max width (or something like that) - so I am just confused how it can be precise.
Thanks!
- hobs 8y agoAfter many days of googling, it looks like postgres doesnt have this problem because it also cant use dynamic memory grants to get better performance on a per-query basis like SQL Server does. So while you never suffer from "under" resourced queries, you generally dont get to see what they would look like if they had more memory. In the SQL Server world that memory grant is part of the query plan, so that's why its a question that occurred to me.