Re: Target lists can have at most 1664 entries?

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Target lists can have at most 1664 entries?
Дата
Msg-id 486B2D36.8020806@postnewspapers.com.au
обсуждение исходный текст
Ответ на Re: Target lists can have at most 1664 entries?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Target lists can have at most 1664 entries?  (Bjørn T Johansen <btj@havleik.no>)
Список pgsql-general
Tom Lane wrote:
> =?UTF-8?Q?Bj=C3=B8rn?= T Johansen <btj@havleik.no> writes:
>> What does this mean and how can it be fixed?
>
> Reduce the number of columns in your SELECTs?
>
> This whiffs to me of excruciatingly bad schema design.  How could you
> possibly need upwards of a thousand columns in a query result?
> IMHO reasonable column counts are O(10), not O(bignum).

(I'm pretty new to Hibernate, so I can only share my general
understanding, but:)

One possible reason is that sometimes tools like Hibernate like to fetch
records from multiple related tables in the database in one query with
chained left joins. They then scan the results and eliminate duplicates
where appropriate.

It sounds horrifying, but it can actually be very fast where fairly
small data sets are being fetched from highly normalized tables with
appropriate indexes. In other circumstances, however, like when there
are very high row counts or lots of fields being returned, it's a very
bad strategy.

My guess is that they haven't told Hibernate to use an appropriate
fetching strategy (multiple SELECTs) for the data they're trying to
load, and for some reason Hibernate is choosing a left join fetch. If
they apply the appropriate annotations to their Hibernate data model or
adjust their HQL queries to avoid "left join fetch" they might find that
the problem goes away - and performance improves significantly.

--
Craig Ringer

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Target lists can have at most 1664 entries?
Следующее
От: Volkan YAZICI
Дата:
Сообщение: Memory Problem