From: | "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> |
---|---|
To: | "Julius Tuskenis" <julius(at)nsoft(dot)lt> |
Cc: | "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org> |
Subject: | Re: [Fwd: performance: view or function?] |
Date: | 2008-05-08 16:42:43 |
Message-ID: | dcc563d10805080942u249839f3o2033aa6c4f98eb68@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
On Thu, May 8, 2008 at 4:16 AM, Julius Tuskenis <julius(at)nsoft(dot)lt> wrote:
> Hello,
>
> I have one question - what is the difference between the view and a
> function returning a data set? I mean the performance. Which is better to
> use? If its the same, I would use functions, because I could use other
> languages not just SQL to get the results I want.
Note that functional indexes may be a good choice for certain actions.
If you always look up tuples based on something like "where
a*80+b<100 or something then a functional index on ((a*80+b)) might be
more useful than a view. You can also create a custom immutable
function and index on that to make it a bit cleaner.
From | Date | Subject | |
---|---|---|---|
Next Message | Giorgio Valoti | 2008-05-09 06:23:30 | Re: [Fwd: performance: view or function?] |
Previous Message | Robert Treat | 2008-05-08 15:00:56 | Re: [Fwd: performance: view or function?] |