Re: Using VIEW to simplify code...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Using VIEW to simplify code...
Дата
Msg-id 22625.1037735261@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Using VIEW to simplify code...  (Chris Gamache <cgg007@yahoo.com>)
Ответы Re: Using VIEW to simplify code...  (Chris Gamache <cgg007@yahoo.com>)
Список pgsql-sql
Chris Gamache <cgg007@yahoo.com> writes:
> Right now I dynamicly generate the SQL for an incredibly ugly 4 table join
> based on user information client-side. I got the bright idea to create a view
> and then run a MUUUCH simpler client-side query on that view. The problem is
> that PostgreSQL apparantly runs the view FIRST and then applies the criteria
> AFTER assembling the whole view.

Not necessarily; it starts with that (which after all is what you wrote)
and tries to transform it into something more efficient.  But it's not
as smart as a person ;-).

> If you MUST have the giant-and-hard-to-maintain-client-generated-sql
> statement and its related explain, I'll produce it.

If you want help, you must provide details.  The PG version number is
relevant also.
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: Chris Gamache
Дата:
Сообщение: Using VIEW to simplify code...
Следующее
От: Chris Gamache
Дата:
Сообщение: Re: Using VIEW to simplify code...