dbTalk Databases Forums  

Re: [BUGS] BUG #1410: Hibernate PerformanceTest is incredibly slow

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] BUG #1410: Hibernate PerformanceTest is incredibly slow in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Oliver Jowett
 
Posts: n/a

Default Re: [BUGS] BUG #1410: Hibernate PerformanceTest is incredibly slow - 01-20-2005 , 05:25 PM






Simon Nicholls wrote:

Quote:
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

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #1410: Hibernate PerformanceTest is incredibly slow - 01-20-2005 , 06:23 PM






Oliver Jowett <oliver (AT) opencloud (DOT) com> writes:
Quote:
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.
That division of labor seems more than a tad brain-dead anyway;
who's to say that the appropriate dialect-specific command is an
ALTER TABLE at all? It would be better if the dialect-specific
code were responsible for emitting the entire command --- in which
case it would have the tablename too and could do the Right Thing.

So I'd suggest filing a bug/enhancement request against Hibernate.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.