Re: two functions in query doubles time?? - Mailing list pgsql-general

From Tom Lane
Subject Re: two functions in query doubles time??
Date
Msg-id 6155.1110137678@sss.pgh.pa.us
Whole thread Raw
In response to two functions in query doubles time??  ("Sim Zacks" <sim@compulab.co.il>)
List pgsql-general
"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

pgsql-general by date:

Previous
From: Tope Akinniyi
Date:
Subject: Re: PRoblems instalation PostgreeSQL8.0.1 in WindowsXP
Next
From: "NTPT"
Date:
Subject: Re: More concurent transaction over single connection