-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: hbm2ddl performance problem with mysql
PostPosted: Thu Sep 11, 2008 3:37 am 
Beginner
Beginner

Joined: Fri Aug 22, 2008 5:49 am
Posts: 22
Hibernate Core version: 3.3.0.SP1
Hibernate annotations version: 3.4.0.GA
Hibernate Tool version: 3.2.2
Name and version of the database you are using: MySQL 5.1.26-rc

I use hibernate tool (hbm2ddl) with Ant to export the schema into DB, in the DDL-file, i got code like this:

Code:
...
...
create table ColumnLayout (_id varchar(36) not null unique, _version integer, _active bit not null, _enabled bit not null, _identifier varchar(255), _name varchar(255), _order integer not null, _visible bit not null, _width integer not null, tablelayout_id varchar(36), sort_idx integer, primary key (_id)) ENGINE=InnoDB;
...
...
alter table ColumnLayout add index fk_tblLayout2colLayout (tablelayout_id), add constraint fk_tblLayout2colLayout foreign key (tablelayout_id) references TableLayout (_id);


and this code is slowly as the code, what mysqldump exported like this:

Code:
CREATE TABLE `columnlayout` (
  `_id` varchar(36) COLLATE utf8_bin NOT NULL,
  `_version` int(11) DEFAULT NULL,
  `_active` bit(1) NOT NULL,
  `_enabled` bit(1) NOT NULL,
  `_identifier` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `_order` int(11) NOT NULL,
  `_visible` bit(1) NOT NULL,
  `_width` int(11) NOT NULL,
  `tablelayout_id` varchar(36) COLLATE utf8_bin DEFAULT NULL,
  `sort_idx` int(11) DEFAULT NULL,
  PRIMARY KEY (`_id`),
  UNIQUE KEY `_id` (`_id`),
  KEY `fk_tblLayout2colLayout` (`tablelayout_id`),
  CONSTRAINT `fk_tblLayout2colLayout` FOREIGN KEY (`tablelayout_id`) REFERENCES `tablelayout` (`_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;



Through test i am sure, that "alter table" is to slowly. And i have 300 tables, but i don't have this Problem with PostgreSQL.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 12, 2008 4:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I dont understand what you are asking about ?

Are you asking why mysql is slower than postgressql to do DML operations ? I would ask in a mysql forum ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 12, 2008 10:21 am 
Beginner
Beginner

Joined: Fri Aug 22, 2008 5:49 am
Posts: 22
max wrote:
I dont understand what you are asking about ?

Are you asking why mysql is slower than postgressql to do DML operations ? I would ask in a mysql forum ;)


the answer is here:

http://forum.hibernate.org/viewtopic.php?t=990480


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.