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
pgsql-bugs by date
|Next:||From: Alexander Kirpa||Date: 2005-01-21 01:24:11|
|Subject: BUG #1427: Seq scan for SELECT 1 FROM p WHERE aid=133 LIMIT 1|
|Previous:||From: Oliver Jowett||Date: 2005-01-20 23:19:55|
|Subject: Re: BUG #1410: Hibernate PerformanceTest is incredibly slow|