Re: "Number of columns exceed limit" on a hierarchy of views

Поиск
Список
Период
Сортировка
От Eric Schwarzenbach
Тема Re: "Number of columns exceed limit" on a hierarchy of views
Дата
Msg-id 4A8EE46D.3030904@blackbrook.org
обсуждение исходный текст
Ответ на Re: "Number of columns exceed limit" on a hierarchy of views  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: "Number of columns exceed limit" on a hierarchy of views
Список pgsql-general
Tom Lane wrote:
> David Waller <daw138a-postgres@yahoo.co.uk> writes:
>
>> I'm struggling with a database query that under some circumstances returns the error "ERROR:  number of columns
(2053)exceeds limit (1664)".  Confusingly, though, no table is that wide. 
>>
>
> This limit would be enforced against the output rows of any intermediate
> join step.  Without looking at EXPLAIN plans it's hard to say exactly
> what's biting you, but it doesn't surprise me a a whole lot that joining
> multiple 500-column tables would get you into trouble.  I'd suggest
> reconsidering your table schemas.  Array columns might help.
>
>             regards, tom lane
>
>
I have a question may be relevant, if a little tangential, to this
problem. When using views that perform joins, will the join order be
enforced by the groupings created by the views, or does the planner
decide the join order just as if there were no views and it all was
written as a single query?

In other words, if you have

create view C select * from A join B on (A.foo = B.foo);
create view D select * from C join E on (C.foo= E.foo);
and you execute some select query on D, does it necessarily join A and B
before joining the result to E, or might it decide to join B with E
first before joining the result to A?

Eric

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: join from array or cursor
Следующее
От: Chris Barnes
Дата:
Сообщение: Postgres bug #4907 : stored procedures and changed tables