Re: View vs function
От | Bruno Wolff III |
---|---|
Тема | Re: View vs function |
Дата | |
Msg-id | 20050321042720.GA27098@wolff.to обсуждение исходный текст |
Ответ на | View vs function (Keith Worthington <KeithW@NarrowPathInc.com>) |
Ответы |
Re: View vs function
|
Список | pgsql-performance |
On Sun, Mar 20, 2005 at 22:39:57 -0500, Keith Worthington <KeithW@NarrowPathInc.com> wrote: > Hi All, > > I have been reading about set returning functions. What I would like to > know is is there a performance advantage in using SRFs versus querying a > view. Assuming the underlying SQL is the same for the view vs the > function except for the WHERE clause which of these would you expect to > be faster? Or does the planner realize all this... In general you are going to be better off with a view, since the planner knows what the view is doing and there may be some optimizations it can make. Functions are just black boxes to the planner. > > SELECT * FROM view_big_query WHERE column1 = 1234; > > SELECT * FROM func_bug_query(1234); > > -- > Kind Regards, > Keith > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq
В списке pgsql-performance по дате отправления: