Re: [GENERAL] Regarding EXPLAIN and width calculations

2010-11-19 Thread Jon Nelson
On Fri, Nov 19, 2010 at 1:09 PM, Tom Lane wrote: > Jon Nelson writes: >> On Fri, Nov 19, 2010 at 12:14 PM, Tom Lane wrote: >>> Hard to comment about this with such an incomplete view of the situation >>> --- in particular, data types would be a critical factor, and I also >>> wonder if you're ad

Re: [GENERAL] Regarding EXPLAIN and width calculations

2010-11-19 Thread Tom Lane
Jon Nelson writes: > On Fri, Nov 19, 2010 at 12:14 PM, Tom Lane wrote: >> Hard to comment about this with such an incomplete view of the situation >> --- in particular, data types would be a critical factor, and I also >> wonder if you're admitting to all the columns involved. > Here is an examp

Re: [GENERAL] Regarding EXPLAIN and width calculations

2010-11-19 Thread Jon Nelson
On Fri, Nov 19, 2010 at 12:14 PM, Tom Lane wrote: > Jon Nelson writes: >> What influences the calculation of the 'width' value in query plans? > > It's generally the sum of the estimated column widths for all the > columns needed at that particular level of the plan. > >> Specifically, I have two

Re: [GENERAL] Regarding EXPLAIN and width calculations

2010-11-19 Thread Tom Lane
Jon Nelson writes: > What influences the calculation of the 'width' value in query plans? It's generally the sum of the estimated column widths for all the columns needed at that particular level of the plan. > Specifically, I have two queries which both query the same set of > tables via either

[GENERAL] Regarding EXPLAIN and width calculations

2010-11-19 Thread Jon Nelson
What influences the calculation of the 'width' value in query plans? Specifically, I have two queries which both query the same set of tables via either UNION or UNION ALL based on the presence (or absence) of an aggregate function. Like this: SELECT a, b FROM foo_1 WHERE a = 'bar' UNION SELECT a