Re: BUG #1410: Hibernate PerformanceTest is incredibly slow

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: BUG #1410: Hibernate PerformanceTest is incredibly slow
Дата
Msg-id 41F03C9B.6040300@opencloud.com
обсуждение исходный текст
Ответ на BUG #1410: Hibernate PerformanceTest is incredibly slow (in effect unusable)  ("Simon Nicholls" <simon@mintsource.org>)
Ответы Re: BUG #1410: Hibernate PerformanceTest is incredibly slow  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Simon Nicholls wrote:

> Bug reference:      1410
> PostgreSQL version: PostgreSQL 8.0
> Operating system:   WindowsXP
> Description:        Hibernate PerformanceTest is incredibly slow (in effect
> unusable)

> 00:41:41,453 DEBUG SchemaExport:136 - drop table Simple
> 00:41:41,500 DEBUG SchemaExport:154 - create table Simple (
>    id_ int8 not null,
>    name varchar(255),
>    address varchar(255),
>    count_ int4 not null unique,
>    date_ timestamp,
>    pay float4,
>    other int8,
>    primary key (id_)
> )
> 00:41:41,656 DEBUG SchemaExport:154 - alter table Simple add constraint
> FK939D1DD26527F10 foreign key (other) references Simple

Without an index on Simple.other, DELETEs on Simple can be slow (each
change requires a seqscan over Simple to check the FK constraint). It
looks like Hibernate's postgresql dialect code does not add an index in
this case.

If I patch Hibernate to not add a FK constraint at all, it runs
substantially faster. It does not seem trivial to fix Hibernate to add
an index in this case -- Hibernate wants to run "ALTER TABLE tablename
<dialect specific sql>" to add a FK constraint, but we need to execute
"ALTER TABLE tablename ADD CONSTRAINT ...; CREATE INDEX .... ON
tablename ..." and the dialect code is not given "tablename".

So to fix this properly needs some work on the Hibernate side.

-O

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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: [pgsql-bugs] Daily digest v1.1346 (21 messages)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #1410: Hibernate PerformanceTest is incredibly slow