Search Postgresql Archives

Re: two functions in query doubles time??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Sim Zacks" <sim@xxxxxxxxxxxxxx> 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

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux