pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Kashmira Patel (kupatel) <kupatel@cisco.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Creating views
Date: Fri, 09 Mar 2007 08:34:00 +0000
Message-ID: <45F11BF8.4080809@archonet.com> (raw)
In-Reply-To: <18AE59788A3FC640A367E5652E664D8003CA26C6@xmb-sjc-237.amer.cisco.com>
References: <18AE59788A3FC640A367E5652E664D8003CA26C6@xmb-sjc-237.amer.cisco.com>

Kashmira Patel (kupatel) wrote:
> Hi all, Is it possible to create views that take parameters?
> Basically, I have to create some very complex historical reports, and
> as of now I am using temporary tables to store intermediate query
> results. I calculate values based on the content of these temporary
> tables and use them in the final result. I would like to eliminate
> the need for temporary tables and use views instead, as the data copy
> between the temp tables is taking quite some time.

You can write a function (in SQL even) that would basically be a 
parameterised view.

However, views don't "store" anything, so whether you see an improvement 
in speed will depend on how long it takes to do your calculations.

-- 
   Richard Huxton
   Archonet Ltd



view thread (2+ messages)

Message-ID: <45F11BF8.4080809@archonet.com>
Permalink:  ../45F11BF8.4080809@archonet.com/
Also on:    postgresql.org/message-id/45F11BF8.4080809@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, kupatel@cisco.com
  Subject: Re: Creating views
  In-Reply-To: <45F11BF8.4080809@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox