-->
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.  [ 2 posts ] 
Author Message
 Post subject: mysql postgres performance (surprise!)
PostPosted: Tue Oct 25, 2005 6:28 am 
Newbie

Joined: Tue Oct 25, 2005 6:04 am
Posts: 10
I have two class hierarchies with depths of 4 and 5. They are mapped using table-per-class strategy. Hierarchies have several one-to-many relationships, all in same direction (one hierarchy is always parent, the other always child). The parent side uses lazy fetching (of child collections), and the child side uses eager fetching (of parent). Everything works fine.

One use case shows a list objects from the child side, but requires that parents are also fetched. The query is quite long, over 2 pages in my full-screen xterm, with many inner and outer joins.

All join columns are indexed, and the where clause is empty.

In MySql (4.1 debian, InnoDB tables) this takes unacceptably long to execute. Sizes of tables don't seem to be an issue as the times for 1, 100 and 1000 objects differ by only about 10%. I have used mysql for over 3 years and am quite familiar with it. I have invested significant time in trying to optimize this.

This was the first time i used postgres (version 8.0.4, debian). Default install, no tweaking whatsoever. The same query runs about 5 times as fast as with mysql. I was shocked. I also found out that the execution time depends mostly on object count.

Is it possible that complex joins choke mysql? Has anyone else had a similar experience? Should I keep optimizing mysql, or should I keep postgres?

Best regards,


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 25, 2005 8:51 am 
Newbie

Joined: Thu Apr 21, 2005 4:59 am
Posts: 15
Keep PostgreSql.
It's a rock solid DBMS with lot more experience on complex queries than MySql.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.