Re: BUG #1410: Hibernate PerformanceTest is incredibly slow

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: Simon Nicholls <simon(at)mintsource(dot)org>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1410: Hibernate PerformanceTest is incredibly slow
Date: 2005-01-21 00:20:28
Message-ID: 10273.1106266828@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Oliver Jowett <oliver(at)opencloud(dot)com> writes:
> 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Kirpa 2005-01-21 01:24:11 BUG #1427: Seq scan for SELECT 1 FROM p WHERE aid=133 LIMIT 1
Previous Message Oliver Jowett 2005-01-20 23:19:55 Re: BUG #1410: Hibernate PerformanceTest is incredibly slow