Skip site navigation (1) Skip section navigation (2)

Re: On the performance of views

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Bill Moran <wmoran(at)potentialtech(dot)com>,Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: On the performance of views
Date: 2004-01-29 18:41:19
Message-ID: 200401291041.19017.josh@agliodbs.com (view raw or flat)
Thread:
Lists: pgsql-performancepgsql-sql
Shridhar, Bill,

> > Is MSSQL allows to mix rows of two types in single function invocation,
> > I am sure that would be a hell lot of porting trouble..

There's also the question of whether or not PG would every want to do this.  
Frankly, as a once-upon-a-time SQL Server application developer, I found the 
ability to return multiple rowsets from a single SQL Server procedure pretty 
useless, and a source of endless debugging if we tried to implement it.

> 1) Returning a homogenious set of rows, but the composition of those rows
>     will not be known until run time, as a different set of logic will be
>     done depending on the values of some parameters.

This can be done with Set Returning Functions.   The issue is that the call to 
the function requires special syntax, and the program calling the function 
must know what columns are going to be returned at the time of the call.  
Hmmm, is that clear or confusing?

> #2 has to be solved at the application level.  My solution so far has
> been to create multiple Postgres functions, call each one in turn, join
> the results in C, and return them as a structure via SOAP to the client.
> May not be the easiest way to get it working, but it's working so far.
> (although I'm always open to suggestions if someone knows of a better
> way)

See my comment above.   I frankly don't understand what the use of a 
non-homogenous recordset is.   Can you explain?

-- 
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

pgsql-performance by date

Next:From: Jack CoatesDate: 2004-01-29 19:04:55
Subject: Re: query optimization question
Previous:From: Tom LaneDate: 2004-01-29 18:05:04
Subject: Re: query optimization question

pgsql-sql by date

Next:From: Bill MoranDate: 2004-01-29 19:12:14
Subject: Re: On the performance of views
Previous:From: Tom LaneDate: 2004-01-29 18:40:55
Subject: Re: query not using index for descending records?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group