# Performance comparison between mutliple tables and multiple databases

**URL:** <https://forums.percona.com/t/performance-comparison-between-mutliple-tables-and-multiple-databases/449>\
**Category:** Other MySQL® Questions\
**Created:** [September 13, 2007, 3:43am UTC](https://forums.percona.com/t/performance-comparison-between-mutliple-tables-and-multiple-databases/449 "2007-09-13T03:43:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hughbedo](https://avatars.discourse-cdn.com/v4/letter/h/cc9497/32.png) [@hughbedo](https://forums.percona.com/u/hughbedo)\
**Post date:** [September 13, 2007, 3:43am UTC](https://forums.percona.com/t/performance-comparison-between-mutliple-tables-and-multiple-databases/449/1 "2007-09-13T03:43:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![scoundrel](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@scoundrel](https://forums.percona.com/u/scoundrel)\
**Post date:** [September 13, 2007, 9:00am UTC](https://forums.percona.com/t/performance-comparison-between-mutliple-tables-and-multiple-databases/449/2 "2007-09-13T09:00:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hughbedo](https://avatars.discourse-cdn.com/v4/letter/h/cc9497/32.png) [@hughbedo](https://forums.percona.com/u/hughbedo)\
**Post date:** [September 13, 2007, 9:10am UTC](https://forums.percona.com/t/performance-comparison-between-mutliple-tables-and-multiple-databases/449/3 "2007-09-13T09:10:35Z")

</div>

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.
