"Sim Zacks" <sim@compulab.co.il> writes:
> I have a view that selects 2 functions, plus other data from a view and 2
> tables.
> A Select * on the join take approximately 1.3 seconds.
> Select function a() from the join takes about 1.3 seconds.
> select function b() from the join takes about 1.3 seconds.
> select a(),b() from the join takes about 2.5 seconds.
You sure about the first of those statements? The explain results sure
look like it's the "functions" that are eating the bulk of the runtime.
> I am looking at the Explain Analyze for the previous 3 queries and it looks
> like a number of the joins are taking 50% longer in the last query.
> Does this make sense? Is there a reason for this?
The estimated row widths are different, implying that different sets of
columns are being pulled from the underlying tables. Pushing more
columns around certainly affects the runtime. (Depending on what
else is in the tables, I suppose this could explain why "select *"
seems so expensive.)
regards, tom lane