pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedviews: performance implication
4+ messages / 4 participants
[nested] [flat]
* views: performance implication
@ 2002-07-04 18:44 John Moore <wx-chase@tinyvital.com>
0 siblings, 1 reply; 4+ messages in thread
From: John Moore @ 2002-07-04 18:44 UTC (permalink / raw)
To: pgsql-admin
We hope to use views as a way to give customers odbc based ad-hoc query
access to our database while enforcing security. The reason is that we do
not want to put data into separate tables by customer, but rather use a
customer ID as part of any query criteria on any table.
So the question is: are there any negative performance implications of
doing so (other than the obvious of having more data in a table than is of
interest to the querying customer)? Back in the old days, views were a
performance no-no in Informix, so I want to be sure we aren't setting a big
trap for ourselves.
Thanks in advance.
John Moore
http://www.tinyvital.com/personal.html
UNITED WE STAND
^ permalink raw reply [nested|flat] 4+ messages in thread
* views: performance implication
@ 2002-07-04 18:45 John Moore <postgres@tinyvital.com>
0 siblings, 1 reply; 4+ messages in thread
From: John Moore @ 2002-07-04 18:45 UTC (permalink / raw)
To: pgsql-admin
We hope to use views as a way to give customers odbc based ad-hoc query
access to our database while enforcing security. The reason is that we do
not want to put data into separate tables by customer, but rather use a
customer ID as part of any query criteria on any table.
So the question is: are there any negative performance implications of
doing so (other than the obvious of having more data in a table than is of
interest to the querying customer)? Back in the old days, views were a
performance no-no in Informix, so I want to be sure we aren't setting a big
trap for ourselves.
Thanks in advance.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: views: performance implication
@ 2002-07-04 19:50 Bruce Momjian <pgman@candle.pha.pa.us>
parent: John Moore <postgres@tinyvital.com>
0 siblings, 0 replies; 4+ messages in thread
From: Bruce Momjian @ 2002-07-04 19:50 UTC (permalink / raw)
To: John Moore <postgres@tinyvital.com>; +Cc: pgsql-admin
John Moore wrote:
> We hope to use views as a way to give customers odbc based ad-hoc query
> access to our database while enforcing security. The reason is that we do
> not want to put data into separate tables by customer, but rather use a
> customer ID as part of any query criteria on any table.
>
> So the question is: are there any negative performance implications of
> doing so (other than the obvious of having more data in a table than is of
> interest to the querying customer)? Back in the old days, views were a
> performance no-no in Informix, so I want to be sure we aren't setting a big
> trap for ourselves.
Views are rewritten as rules for every query issued, so there is little
performance impact except for the complexity of your view (GROUP BY,
aggregates, etc.)
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: views: performance implication
@ 2002-07-08 03:03 Curt Sampson <cjs@cynic.net>
parent: John Moore <wx-chase@tinyvital.com>
0 siblings, 0 replies; 4+ messages in thread
From: Curt Sampson @ 2002-07-08 03:03 UTC (permalink / raw)
To: John Moore <wx-chase@tinyvital.com>; +Cc: pgsql-admin
On Thu, 4 Jul 2002, John Moore wrote:
> We hope to use views as a way to....
> So the question is: are there any negative performance implications of
> doing so ... Back in the old days, views were a
> performance no-no in Informix, so I want to be sure we aren't setting a big
> trap for ourselves.
Yes, there may be. There are some cases where the optimizer won't
optimize a view the way it will optimize an equivalant query. (I posted
a query about this a while back--I don't remember whether it was here
or on -hackers.) So after creating a view, you'll want to check with
EXPLAIN that you're still getting the same query plan.
But I don't think this is true of every view, just some of them.
cjs
--
Curt Sampson <cjs@cynic.net> +81 90 7737 2974 http://www.netbsd.org
Don't you know, in this new Dark Age, we're all light. --XTC
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2002-07-08 03:03 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-07-04 18:44 views: performance implication John Moore <wx-chase@tinyvital.com>
2002-07-08 03:03 ` Curt Sampson <cjs@cynic.net>
2002-07-04 18:45 views: performance implication John Moore <postgres@tinyvital.com>
2002-07-04 19:50 ` Bruce Momjian <pgman@candle.pha.pa.us>
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