| Performance comparison between mutliple tables and multiple databases [message #1808] |
Thu, 13 September 2007 05:13  |
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   |
|
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  |
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.
|
|
|