Home » Performance » MySQL » Performance comparison between mutliple tables and multiple databases
Performance comparison between mutliple tables and multiple databases [message #1808] Thu, 13 September 2007 05:13 Go to next message
hughbedo  is currently offline hughbedo
Messages: 2
Registered: September 2007
Location: Oxford
Junior Member
What are the performance implications of storing some data across 2 databases instead of duplicating this data in both databases? ie. is example 1 significantly slower than example 2:

Example 1:
SELECT Users.User.*, Transactions.Sales.date
FROM Users.User, Transactions.Sales
WHERE Users.User.id=Transactions.Sales.userid;

Example 2:
SELECT Users.User.*, Users.Sales.date
FROM Users.User, Users.Sales
WHERE Users.User.id=Users.Sales.userid;

Note in Example 2 the database Users would be significantly larger as it has data duplicated from the database Transactions.

Thanks for any help.
Re: Performance comparison between mutliple tables and multiple databases [message #1812 is a reply to message #1808 ] Thu, 13 September 2007 10:30 Go to previous messageGo to next message
scoundrel  is currently offline scoundrel
Messages: 58
Registered: August 2006
Location: Toronto, ON, Canada
Member

Do you mean that you want to insert data in two DBs at the same time just to be able to use selects in one db? If yes, I'd not suggest to do so. AFAIK, there is no performance differences between one db queries and cross-db queries in MySQL at all.


Alexey Kovyrin, MySQL Performance Expert
MySQL Performance Blog
MySQL Consulting
Re: Performance comparison between mutliple tables and multiple databases [message #1815 is a reply to message #1812 ] Thu, 13 September 2007 10:40 Go to previous message
hughbedo  is currently offline hughbedo
Messages: 2
Registered: September 2007
Location: Oxford
Junior Member
Yes, that is basically what I am asking. To be honest I want to keep it as 2 databases and only have one copy of the data, not only because it is better from a data integrity standpoint, but it is less work for me. However the performance question was raised as a reason to have 2 copies of the data.

If you are right that it is just as quick to run a query across 2 databases it is much better for me.

Thanks for the help.
Previous Topic:Out of memory error and duplicate entry error (in error log)
Next Topic:4GB limit on 32 bit os?
Goto Forum:
  


Current Time: Sun Jul 5 17:39:05 EDT 2009

Total time taken to generate the page: 0.01187 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software

MySQL is a trademark of Sun Microsystems.
InnoDB is a trademark of Oracle Corp.

Percona Performance Forums are a service of Percona, Inc.
Not affiliated with Sun Microsystems or Oracle Corp.